Announcement

Collapse
No announcement yet.

bat file not running...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bat file not running...

    Hello,

    How is everyone?
    Im running into a situation with a simple batch file that i would like to run every 15 mins.
    I know this is simple to you guys, but to me its all new. Basically, i created an event to run every 15mins.. but everytime it runs the batch file it states in the log files that it has "invalid character"

    What i dont understand is why is it considering it a invalid character.

    here is the basic batch file that i am using.

    @ECHO OFF
    SETLOCAL EnableDelayedExpansion
    FOR %%a IN (front house) DO (
    MOVE "C:\Documents and Settings\All Users\Documents\*%%a*.avi" "y:"
    )
    PAUSE


    Any help would be greatly appreciated.

    john

  • #2
    What exactly are you trying to do and we can probably come up with a vb script to do the same.
    -Rupp
    sigpic

    Comment


    • #3
      When you run this from a DOS prompt, does it error? If so, is it the same error?

      I'm assuming that you are using a conditional to move video files from one drive to another ...
      Don

      Comment


      • #4
        You could use some code like this in a .vb script to move files:

        Dim files As String() = System.IO.Directory.GetFiles("c:\temp", "*.jpg")

        For Each File In files
        System.IO.File.Copy(File, "c:\temp\moved\" & system.IO.Path.GetFileName(File))
        Next
        -Rupp
        sigpic

        Comment


        • #5
          Originally posted by vteccured View Post
          @ECHO OFF
          SETLOCAL EnableDelayedExpansion
          FOR %%a IN (front house) DO (
          MOVE "C:\Documents and Settings\All Users\Documents\*%%a*.avi" "y:"
          )
          PAUSE


          Any help would be greatly appreciated.

          john
          What is the "*%%" ment to do ?

          I used to use two bat files to mave files about, the 1st is
          Code:
          cd C:\Program files\homeseer\html\WebCam\AVerDVD EZMaker USB 20 Video Capture\
          move c:\temp\*.wmv W:\
          cd C:\Program files\homeseer\html\temp
          copy *.jpg C:\Program files\homeseer\html\WebCam\AVerDVD EZMaker USB 20 Video Capture
          and the other
          Code:
          cd c:\program files\homeseer\html
          DEL courtyard.wmv
          cd\
          copy v:\courtyard.wmv c:\program files\homeseer\html\
          I no longer use them as I now run Geovision, but they worked perfectly. The files were on a remote compter therefor the mapped drives, but it will also work on a local compter, just need the full path to whe destonation.
          sigpic
          A founder member of "The HA Pioneer Group" otherwise known as the "Old farts club!"
          HomeSeer 3 V 3.0.0.318 with ALEXA (AKA Amazon Echo)
          BL Radar V2.0.217; BLRF V2.0.85.0; HS Touch V3.0.0.1034 X10 V3.0.0.42; PHLocation V3.0.0.38; Zwave V3.0.1.110; X10 V3.0.0.42
          BLBackup V2.0.39;ImperiHome3.0.0.20 All on Windows XP Pro

          Comment

          Working...
          X