| | |
Batch Script - Error 7901???
![]() |
•
•
Join Date: Jun 2005
Posts: 6
Reputation:
Solved Threads: 0
Hi Everyone,
I have created a simple batch file which uses three 'AT' commands to schedule tasks. The tasks are set to run on a Friday, Saturday and Sunday night respectively at 23:00, and are simply a defrag of the two partitions on my system and a Spyware scan also.
I have included the AT commands below:
at 23:00 /every:f "c:\WINNT\system32\dfrg.exe d: -f"
at 23:00 /every:s "c:\WINNT\system32\dfrg.exe c: -f"
at 23:00 /every:su "c:\program files\microsoft antispyware\giantantispywaremain.exe -scan -withoutui"
The script runs fine and schedules the tasks but if I try and run any of the three immediately I get an error in Event Viewer 7901: The System cannot find the file specified.
The OS I am running is Windows 2000 Professional and to my knowledge both the defragmenter and Spyware software are DEFINATELY in the locations specified above. So I am perplexed as to why "The System cannot find the file specified".
Does anyone have any suggestions as to what could be causing the problem??? And how best to rectify it???
Thank you in advance for your anticipated assistance.
Kind Regards,
Darren King
I have created a simple batch file which uses three 'AT' commands to schedule tasks. The tasks are set to run on a Friday, Saturday and Sunday night respectively at 23:00, and are simply a defrag of the two partitions on my system and a Spyware scan also.
I have included the AT commands below:
at 23:00 /every:f "c:\WINNT\system32\dfrg.exe d: -f"
at 23:00 /every:s "c:\WINNT\system32\dfrg.exe c: -f"
at 23:00 /every:su "c:\program files\microsoft antispyware\giantantispywaremain.exe -scan -withoutui"
The script runs fine and schedules the tasks but if I try and run any of the three immediately I get an error in Event Viewer 7901: The System cannot find the file specified.
The OS I am running is Windows 2000 Professional and to my knowledge both the defragmenter and Spyware software are DEFINATELY in the locations specified above. So I am perplexed as to why "The System cannot find the file specified".
Does anyone have any suggestions as to what could be causing the problem??? And how best to rectify it???
Thank you in advance for your anticipated assistance.
Kind Regards,
Darren King
•
•
Join Date: Jun 2005
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by MartyMcFly
Could you not run it throught scheduled tasks in the control pannel
The 'AT' commands place an entry in the Scheduled Tasks pane under Control panel for each job. The reason I am using a batch file rather than just creating them manually within Scheduled Tasks is we plan to push this script out using Group Policy.
But I am testing the batch file locally on my machine first but I am getting this issue. It does create the Scheduled Tasks but they fail immediately with the earlier mentioned error.
Any idea as to what the problem could be???
Thanks in advance for your assistance.
Regards,
Darren King
•
•
Join Date: Feb 2005
Posts: 675
Reputation:
Solved Threads: 17
I spent 30mins looking at this, with interest, and cant work out what you have done wrong.
The script looks perfect as long as you have the right location and file name. How come your defrag isn't defrag.exe.
Must be something with the location and command, because the rest is fine.
But if you can run
c:\WINNT\system32\dfrg.exe d: -f
from the run command in start menu, then....
The script looks perfect as long as you have the right location and file name. How come your defrag isn't defrag.exe.
Must be something with the location and command, because the rest is fine.
But if you can run
c:\WINNT\system32\dfrg.exe d: -f
from the run command in start menu, then....
I use psexec and contig http://www.sysinternals.com
instead of scheduling I use one computer to push the defrag and run it on 200 computers every weekend.
(\\*) Pushes it out to all computers in net view
instead of scheduling I use one computer to push the defrag and run it on 200 computers every weekend.
psexec \\* -c -u Administrator -p Password contig -q -s c:\*.*
(\\*) Pushes it out to all computers in net view
![]() |
Similar Threads
- internet explorer script error (Windows 95 / 98 / Me)
- Internet Explorer script error (Web Browsers)
Other Threads in the Windows NT / 2000 / XP Forum
- Previous Thread: How to make ''total'' defragment
- Next Thread: Reinstall Win XP problemos
| Thread Tools | Search this Thread |
.net 3.5 3daccelertion 64bit 2010 activedirectory alaris android apache application arm auto black blue book canonical cellphones chinese codeplex collaboration combofix computer computerfreezes crash desktop desktops domain dotnetnuke drive error errors explorer features folder fonts freeze gadgets hardware home intel killprocess laptop laptops latitude lcd linux load mac markshuttleworth microsoft minimalizes mobile monitor netbooks novell nvidia opensource operatingsystems options oracle osinstallationproblem osx outlook partition patch port product proxy raid rds reformat remotedesktopconnection retail screen server. sp1 sp3 spyware studios ubuntu unreadable update upgrade usb verizon videogames virtual virus vulnerability wab webos weecam win win32/heur window windows windows7 windowsxp worm xp





