Good morning everyone,
i try to write a script to do the following example (all in cmd):
- execute command
- wait for the command to be finished
- close the cmd window and open a new one
- execute another command
- exit
My problem is at point 2 and 3. exit is not possible because the script is terminated .
And with the command start cmd /k <command> a new cmd instance will be opend and both commands (1 and 4) will be executed at once.
Thx in advance
EDIT: The requested code
cup chocolatey
exit // Not working
cup all -y
pause
EDIT: The solution
@echo off
cup chocolatey
SCHTASKS /delete /tn "updateAll" /f
SCHTASKS /create /tn "updateAll" /tr "cmd.exe /c \"cup all -y\"" /sc ONCE /ST 00:00 /sd 01/01/1910 /RL HIGHEST
SCHTASKS /run /tn "updateAll"
EXIT
callor astart /bgoing. Show us your code.SCHTASKSto do this....