0

I have done a little experimenting with this task and I have the majority of it working. Basically the Task runs this command line

cmd.exe /c set y1=%date:~-4,4%&set m1=%date:~-10,2%&set d1=%date:~-7,2%&set nti=%time: =0%&set h1=%nti:~0,2%&set m2=%nti:~3,2%&move /Y %deployroot%\Captures\%RealComputerName% %deployroot%\Captures\Completed\%RealComputerName%_%y1%%m1%%d1%_%h1%%m2%

But when the command actually runs I get a moved folder with the name

MyComputerName_%y1%%m1%%d1%_%h1%%m2%

If I execute the command manually from the deployment server in a dos window everything works as it should and I get a moved folder with the name

MyComputerName_20130305_1029

What am I missing, why cant I get my task to run properly ?

KingBain
  • 31
  • 3

1 Answers1

1

I respect your one-liner, but it is difficult to parse. Is is possible that %DATE% is not available? The below code worked for me.

FOR /F "delims=" %%i IN ('date /t') DO set DT=%%i
FOR /F "delims=" %%i IN ('time /t') DO set TM=%%i

SET SRC=%deployroot%\Captures\%RealComputerName%
SET DST=%deployroot%\Captures\Completed
set y1=%DT:~10,4%
set m1=%DT:~4,2%
set d1=%DT:~7,2%
set h1=%TM:~0,2%
set m2=%TM:~3,2%

move /y %SRC% %DST%\%RealComputerName%_%y1%%m1%%d1%_%h1%%m2%
Bin
  • 844
  • 5
  • 15