mikesw Posted January 7, 2008 Posted January 7, 2008 I have defrag.exe running as part of a scheduled task using my login username.When the scheduled task starts, it displays an empty popup box.Is there a way to run the scheduled task without showing me a popup box? Sort oflike a silent run mode......For windows 2K, the best match for windows XP defrag is the filename calleddfrgntfs.exe in the system32 directory. However, I can't get it to show meany commandline options so that I know what to specify when I setup thedfrgntfs.exe (defrag) utility under win 2K. Are there any options for Win 2K defrag?My win XP defrag uses the following commandline "defrag.exe C: -f"
jftuga Posted January 7, 2008 Posted January 7, 2008 I wrote an AutoIt v3 script to do this, see www.autoitscript.com. You can compile the wh.au3 into a stand-alone .exe file.-John;; wh.au3 -- winhide; -John Taylor; Oct-12-2006;; I use this to hide svchost cmd windows that are; launched from a Scheduled Task;; 1st cmd-line arg : partial window title; 2nd cmd-line arg : optional, always should be "1", shows a windows; instead of hiding one;#notrayiconOpt("MustDeclareVars", 1)Opt("WinTitleMatchMode", 2)Const $max = 4Dim $rv, $iif 0 == $CmdLine[0] then MsgBox(16, "Error", "You must give a partial window title on the command-line.") exitendifif 1 == $CmdLine[0] then for $i=1 to $max $rv = WinSetState ( $CmdLine[1], "", @SW_HIDE ) nextendifif 2 == $CmdLine[0] then if "1" == $CmdLine[2] then for $i=1 to $max $rv = WinSetState ( $CmdLine[1], "", @SW_SHOW ) next endifendif;; end of script
mikesw Posted January 7, 2008 Author Posted January 7, 2008 Thanks iftuga, I'll try it out.I've also found out that Win 2K doesn't allows the dfrgntfs.exe to be run under the sched task. Defrag was added to allow this under windows. In my searches, I came across this which wrapsthe dfrgsntfs.exe on Win 2K machines to allow one to do defrags at scheduled times on Win 2k.http://sourceforge.net/projects/autodefrag/I'll try autodefrag v1.2 out later along with the above script too.I also know that defrag.exe can be run using the "at" command, (but not for win 2k per above comment).This seems to be the only way to allow me to run defrag without being logged in as a user which has adminprivelges.
mikesw Posted January 7, 2008 Author Posted January 7, 2008 Heres a GNU program for defragging Win 2K thru Vista. So it can replace autodefragfor win 2K from sourceforge.http://www.kessels.com/JkDefrag/And a bug with Sata driveshttp://support.microsoft.com/kb/941715/enIt can't do windows hiding so it will needs iftugas software.Also there is dirms, but not free anymore which runs defrag as a serviceand thus defrags all the time.
mikesw Posted January 7, 2008 Author Posted January 7, 2008 IFTUGA,How do I use this with the sched task "defrag.exe"?I've compiled it and ran at the command prompt "wh t 1"Or is it "wh 1 c:\windows\system32\defrag c: -f" Or ???Why do I need a partial window name?
mikesw Posted January 10, 2008 Author Posted January 10, 2008 (edited) IFTUGA, The wh program that you posted doesn't seem to stop the popup windows under the sched task.I've done the following.a). Entered the following command within the RUN box of sched taskwh defrag;defrag.exe C:b ). Put the wh and defrag commands in a batch file and entering the batch filename in RUN box of sched task.wh defragdefrag.exe C:c). The only way I can get the box to disappear is to run "defrag.exe C:" as userNT AUTHORITY SYSTEM without a password. It seems to run, but am not sure if it is doing anything. Edited January 10, 2008 by mikesw
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now