Computing.Net > Forums > Windows 2000 > Batch Script Not Working

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Script Not Working

Reply to Message Icon

Name: Dazza2005
Date: June 15, 2005 at 03:44:00 Pacific
OS: Windows 2000
CPU/Ram: Pentium Centrino/512MB
Comment:

Hi,

I have created a simple script using three 'AT' commands to schedule a defrag of both my C & D partitions at 23:00 every Friday & Saturday respectively. And also to run a Spyware scan every Sunday at 23:00 also.

But although the script runs and adds the scheduled tasks if I try and run one I get an error message:

Event ID: 7901 - The system cannot find the file specified.

Although the locations the 'AT' commands are pointing to appear valid. The OS is W2K Professional.

I have included the three '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"

Any suggestions as to what the problem could be would be greatly received.

Thanks in advance for your anticipated assistance.

Regards,

Darren King



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: June 15, 2005 at 03:57:35 Pacific
Reply:

I suppose the problem is due to the following path with embedded blanks

c:\program files\microsoft antispyware\giantantispywaremain.exe

as the " characters must be used to embed the command, I suggest you use the short format for directories that you can retrieve by typing the Dir /X command, i.e..

Dir /X "C:\Program files"
Dir /X "C:\Program files\microsoft antispyware"

and replace the long file name path with the terse one.


0

Response Number 2
Name: Dazza2005
Date: June 15, 2005 at 04:39:19 Pacific
Reply:

Ivo,

Thank you for the advice, so would this problem also affect the other two 'AT' commands also - as they are giving the same problem when I try to run them.

If so how to you suggest I alter the script in order to eradicate this issue???

Thanks for your assistance.


0

Response Number 3
Name: IVO
Date: June 15, 2005 at 06:50:27 Pacific
Reply:

The two defrag tasks would not be affected by the posted issue as their path holds no blank inside, but are you sure about the executable name and its location?. I'm runing Windows XP SP2 (much like Windows 2000) and here the defarg executable is just "defrag.exe" not "dfrg.exe". And more it is located in "C:\Windows\System32" directory. About the last issue I know under Windows 2000 systems the "Windows" folder is actually "WinNT" as a legacy of its Windows NT ancestor.


0

Response Number 4
Name: Mechanix2Go
Date: June 15, 2005 at 07:17:52 Pacific
Reply:

I run w2k SP3 and it has:

C:\winnt\system32\dfrgfat.exe
C:\winnt\system32\dfrgntfs.exe

When I type in:

dfrgfat /?

a window pops and says:

Command line operation of Disk Defrgamenter is not supported.

So I guess a BAT with AT is a no-go.

Looks like you're stuck with Task Scheduler.

M2


If at first you don't succeed, you're about average.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Batch Script Not Working

printing script not working www.computing.net/answers/windows-2000/printing-script-not-working/51132.html

logon script for Profile not working www.computing.net/answers/windows-2000/logon-script-for-profile-not-working/28338.html

Batch Files for Login Script Not Working www.computing.net/answers/windows-2000/batch-files-for-login-script-not-working/32923.html