Commands not working from bat file

B

Bob Day

In windows XP Pro, I have 4 Control Panel, Scheduled Tasks. The task itself
runs a .bat file, with that .bat executing the task. The issue is not with
Scheduled Tasks, but with why certain commands don't work form a .bat file.

chkdsk works fine from the .bat file (whether run from Scheduled Tasks or
run manually).
Shutdown and Defrag, however, do nothing when executed from the bat file,
even if the bat file is run manually from a command prompt. It I manually
type in the command line in the bat file for the same folder, both run fine.

The actual command line for each .bat file is:
defrag C: -v
shutdown -r -f -t 30 -c "Scheduled Reboot Final Before Solution Runs"

Why do these not work from a .bat file?

Bob Day
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top