Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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.

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.

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.

I run w2k SP3 and it has:
C:\winnt\system32\dfrgfat.exe
C:\winnt\system32\dfrgntfs.exeWhen 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.

![]() |
![]() |
![]() |

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