Reputation: 491
Can someone please tell me what in the following command line not correct is?
${WORKSPACE} = C:\jenkins\workspace\compile-job
cmd.exe /s /c START /b /BELOWNORMAL
mkdir C:\jenkins\workspace\old
move /Y %WORKSPACE%\* C:\jenkins\workspace\old
rmdir /q /s C:\jenkins\workspace\old
Upvotes: 1
Views: 5476
Reputation: 354416
Plenty.
${WORKSPACE} = ...
is neither cmd
nor PowerShell syntax, it's nothing sensible. Use
set WORKSPACE=C:\jenkins\workspace\compile-job
instead.
You can have multi-line commands by ending the line before with ^
. However you want to execute three commands instead of just one. One option would be to write a batch file to execute (certainly the cleanest approach). But since you already have one, you can get clever:
if not %1==x (
START "" /b /BELOWNORMAL %0 x
goto :eof
)
set WORKSPACE=C:\jenkins\workspace\compile-job
mkdir C:\jenkins\workspace\old
move /Y %WORKSPACE%\* C:\jenkins\workspace\old
rmdir /q /s C:\jenkins\workspace\old
This will execute the batch file again but with an argument and within the batch we look whether that argument is present and do the work or not.
Upvotes: 1