Script will not run properly.

Microsoft Windows xp professional w/serv...
March 9, 2010 at 07:08:06
Specs: Windows XP
Hi, Can anyone tell me why this Script will not run. What I am trying to do is copy all the files from one directory into another. And then as new files are added to the main folder have only that new file copied to the new folder.

@Echo OFF

:: NIHFILECOPY.BAT Syntax: c:\NIHFILECOPY\NIHFILECOPY.bat C:\batchtest1 C:\batchtest2 [05/03/2010]

Set ToDay=%3
If not "%ToDay%"=="" GoTo EXEC
For /F "Tokens=2 Delims= " %%a in ('Date /T') Do Set ToDay=%%a
Dir %1 /X | Find "%ToDay%" | Find /V "C:\WINDOWS\system32\find.exe" > %0$1.tmp
For /F "Tokens=4 Delims= " %%i in (%0$1.tmp) Do Copy %1\%%i %2 > Nul
Del %0$1.tmp
Set ToDay=

See More: Script will not run properly.

Report •

March 9, 2010 at 07:50:02
Anyone have any idea?

Report •

March 9, 2010 at 14:01:15
I'm not very knowledgeable about batch files. But I 'think' I see a problem.
I think the following should be surrounded by quotation marks:

Also I have had a strange problem (rarely) with file names surrounded by quotes when they didn't need them, like the following:

For the actual coding of the batch, I'm afraid I can't help.

Report •

Related Solutions

Ask Question