5

I am trying to create a really simple task that uses sdelete command as a scheduled task but when I run the task the CMD just flickers on and off and does not perform the task, so I want to see what it is doing on the CMD to troubleshoot the problem by keeping it on after it has completed.

program/script:

C:\Windows\System32\cmd.exe

Argument:

/c "sdelete -z"

Start in:

C:\Users

3 Answers 3

4

Create a new text file and put this in it:

sdelete -z
pause

Save this file as test.bat, making sure to select "All Files" in the filetype dropdown, to avoid the file being named test.bat.txt.

Now run the batch file.The pause command will pause script execution and allow you to see any output in the command window.

2

Place pause at the end of the script and it will pause until a key press is reconsidered

Although if this is not a script and just an argument place > output.txt at the end and it will output the argument to a file called output.txt in the location it was run

0

The argument " /c " after cmd.exe just carries out the command and then terminates the CMD, but you can use

cmd.exe /k "sdelete -z"

that carries out the command too, but remains.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .