943,969 Members | Top Members by Rank

Ad:
Jun 15th, 2005
0

Batch Script - Error 7901???

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dazza is offline Offline
6 posts
since Jun 2005
Jun 15th, 2005
0

Re: Batch Script - Error 7901???

Could you not run it throught scheduled tasks in the control pannel
Reputation Points: 16
Solved Threads: 17
Practically a Master Poster
MartyMcFly is offline Offline
675 posts
since Feb 2005
Jun 15th, 2005
0

Re: Batch Script - Error 7901???

Quote originally posted by MartyMcFly ...
Could you not run it throught scheduled tasks in the control pannel
Hi Marty,

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Dazza is offline Offline
6 posts
since Jun 2005
Jun 15th, 2005
0

Re: Batch Script - Error 7901???

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....
Reputation Points: 16
Solved Threads: 17
Practically a Master Poster
MartyMcFly is offline Offline
675 posts
since Feb 2005
Jun 16th, 2005
0

Re: Batch Script - Error 7901???

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.


psexec \\* -c -u Administrator -p Password contig -q -s c:\*.*

(\\*) Pushes it out to all computers in net view
Reputation Points: 20
Solved Threads: 5
Junior Poster
jwshepherd is offline Offline
123 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Windows NT / 2000 / XP Forum Timeline: How to make ''total'' defragment
Next Thread in Windows NT / 2000 / XP Forum Timeline: Reinstall Win XP problemos





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC