chiners_68 Posted January 24, 2007 Posted January 24, 2007 will autoit scripts execute at runonce in windows XP..?
sandyd Posted January 24, 2007 Posted January 24, 2007 No reason they shouldn't Just add them to the runonce key in the registry ----[ SandyD ]---
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 have done that along with all my apps I install, but it not worky.
sandyd Posted January 24, 2007 Posted January 24, 2007 Any error messages? Does the script run fine when executed normally? ----[ SandyD ]---
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 its a GUI script which runs defrag automatically after 6 seconds. it works fine in windows but not at runonce.
sandyd Posted January 24, 2007 Posted January 24, 2007 Just out of interest, put a sleep delay of about 1 minute before any of your code (top line) That way the PC will have time to get itself sorted before running the script. Try it and see if that helps ... ----[ SandyD ]---
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 Just out of interest, put a sleep delay of about 1 minute before any of your code (top line)That way the PC will have time to get itself sorted before running the script.Try it and see if that helps ...ive tried it in HKLM runonce & runonceEX but it wont run. ive also tried in HKCU rinonce which runs once into windows but this dosent run either. the script is compiled to defrg.exe in the windows\system32 directory. it runs in windows but not in any runonce.
MHz Posted January 24, 2007 Posted January 24, 2007 (edited) Need more information. 1. Does the au3 scripts run when double clicked from explorer? 2. What is the command being used to add the entry into the registry? Edited January 24, 2007 by MHz
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 Here is the scriptOpt("GUIOnEventMode", 1) ; Change to OnEvent mode$started = 1$mainwindow = GUICreate("Defragmentation", 200, 100) GUICtrlCreateLabel("Automating defrag in 6 seconds", 30, 10)$btnExit = GUICtrlCreateButton("Skip", 70, 50, 60);GUISetOnEvent($GUI_EVENT_CLOSE, "_Terminate")GUICtrlSetOnEvent($btnExit, "_Terminate")GUISetState(@SW_SHOW)While 1 Sleep(6000) If $started Then Run("defrag.exe c: -f", "", @SW_HIDE) EndIf ExitWendFunc _Terminate() $started = 0 ExitEndFunchere is runonceSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%02 /VE /D "BTS Driver Pack Finisher" /fREG ADD %KEY%02 /V 1 /D "%SystemDrive%\DPsFnshr.exe" /fREG ADD %KEY%02 /V 2 /D "reschangecon.exe -width=1024 -height=768 -depth=32" /fREG ADD %KEY%15 /VE /D "McAfee VirusScan Enterprise 8.0" /fREG ADD %KEY%15 /V 1 /D "%systemdrive%\install\VE8.0iPatch13\setup.exe /qb" /fREG ADD %KEY%15 /V 2 /D "%systemdrive%\install\sdat4944.exe /silent" /fREG ADD %KEY%25 /VE /D "Adobe Reader 8.0" /fREG ADD %KEY%25 /V 1 /D "%systemdrive%\install\reader8.exe" /fREG ADD %KEY%50 /VE /D "Macromedia Shockwave 10.0.1" /fREG ADD %KEY%50 /V 1 /D "%systemdrive%\install\Shockwave10.exe" /fREG ADD %KEY%60 /VE /D "Cleanup" /fREG ADD %KEY%60 /V 1 /D "REGEDIT /s %WINDIR%\system32\regcleanup.reg" /fREG ADD %KEY%60 /V 2 /D "%WINDIR%\system32\cleanup.cmd" /fREG ADD %KEY%70 /VE /D "Defragmentation" /fREG ADD %KEY%70 /V 1 /D "%WINDIR%\system32\defrg.exe" /fREG ADD %KEY%70 /V 2 /D "%WINDIR%\system32\defrg.exe" /fREG ADD %KEY%90 /VE /D "Restarting Computer" /fREG ADD %KEY%90 /V 1 /D "%WINDIR%\system32\restart.cmd" /frunonce works fine. i use to use a js script for the defrag but it didnt have the GUI i wanted thus the reason for creating one in Autoit. If i have no success ill go back to my js version.
MHz Posted January 24, 2007 Posted January 24, 2007 Your missing a backslash in your cmd file. Notice the KEY Environmental Variable change. SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\ REG ADD %KEY% /V TITLE /D "Installing Applications" /f REG ADD %KEY%02 /VE /D "BTS Driver Pack Finisher" /f REG ADD %KEY%02 /V 1 /D "%SystemDrive%\DPsFnshr.exe" /f REG ADD %KEY%02 /V 2 /D "reschangecon.exe -width=1024 -height=768 -depth=32" /f REG ADD %KEY%15 /VE /D "McAfee VirusScan Enterprise 8.0" /f REG ADD %KEY%15 /V 1 /D "%systemdrive%\install\VE8.0iPatch13\setup.exe /qb" /f REG ADD %KEY%15 /V 2 /D "%systemdrive%\install\sdat4944.exe /silent" /f REG ADD %KEY%25 /VE /D "Adobe Reader 8.0" /f REG ADD %KEY%25 /V 1 /D "%systemdrive%\install\reader8.exe" /f REG ADD %KEY%50 /VE /D "Macromedia Shockwave 10.0.1" /f REG ADD %KEY%50 /V 1 /D "%systemdrive%\install\Shockwave10.exe" /f REG ADD %KEY%60 /VE /D "Cleanup" /f REG ADD %KEY%60 /V 1 /D "REGEDIT /s %WINDIR%\system32\regcleanup.reg" /f REG ADD %KEY%60 /V 2 /D "%WINDIR%\system32\cleanup.cmd" /f REG ADD %KEY%70 /VE /D "Defragmentation" /f REG ADD %KEY%70 /V 1 /D "%WINDIR%\system32\defrg.exe" /f REG ADD %KEY%70 /V 2 /D "%WINDIR%\system32\defrg.exe" /f REG ADD %KEY%90 /VE /D "Restarting Computer" /f REG ADD %KEY%90 /V 1 /D "%WINDIR%\system32\restart.cmd" /f
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 cant see anything missing..? can you highlight im blind..lol
MHz Posted January 24, 2007 Posted January 24, 2007 You need to have a trailing backslash to create the numbers keys under the RunOnceEx key. SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\ Before in registry RunOnceEx RunOnceEx01 RunOnceEx02 RunOnceEx03 After in registry with change RunOnceEx - 01 - 02 - 03 Without the backslash, then keys were being created outside of the RunOnceEx key rather then inside the RunOnceEx key.
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 ill add it but the key creates fin. ive run the batch file & checked the keys exist. the rest of the runonce runs ok its just the defrg.exe that dosent run.
MHz Posted January 24, 2007 Posted January 24, 2007 change this Run("defrag.exe c: -f", "", @SW_HIDE) oÝ÷ ÚÚ-+ºÚ"µÍBT[ØZ] ][ÝÙYYË^HÎY][ÝË ][ÝÉ][ÝËÕ×ÒQJB so the script waits for defrag.exe to finish defragging the drive.
Danny35d Posted January 24, 2007 Posted January 24, 2007 REG ADD %KEY%70 /VE /D "Defragmentation" /fREG ADD %KEY%70 /V 1 /D "%WINDIR%\system32\defrg.exe" /fREG ADD %KEY%70 /V 2 /D "%WINDIR%\system32\defrg.exe" /fMiss spell defrg.exe it shoulbe defrag.exe also you are missing the drive to defrag.REG ADD %KEY%70 /VE /D "Defragmentation" /fREG ADD %KEY%70 /V 1 /D "%WINDIR%\system32\defrag.exe %SystemDrive%" /fREG ADD %KEY%70 /V 2 /D "%WINDIR%\system32\defrag.exe %SystemDrive%" /f AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
MHz Posted January 24, 2007 Posted January 24, 2007 Miss spell defrg.exe it shoulbe defrag.exe also you are missing the drive to defrag.Nah, that is the AutoIt script, not defrag.exe.
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 MHZ, its not Run("defrag.exe c: -f", "", @SW_HIDE) line which is a problem. the GUI before this part of the script runs dosent run itself. works fine in windows. Danny35D, im not running microsft defrag direct. ive got an autoit script callded defrg.exe which brings up a GUI for 6 seconds before it runs defrag.exe. its still not working with the backslash added to the runonce.
MHz Posted January 24, 2007 Posted January 24, 2007 Change it to RunWait. Everything looks ok at another glance. Perhaps Danny35D can see what I cannot.
chiners_68 Posted January 24, 2007 Author Posted January 24, 2007 runwait is no good it pauses the GUI
MHz Posted January 24, 2007 Posted January 24, 2007 (edited) runwait is no good it pauses the GUIYes, and stops your next entry in RunOnceEx running if your script exits before defrag.exe finishes. You can hide your gui or delete it before the RunWait if you do not want to see the Gui anymore. But your script needs to run while defrag.exe does. Edited January 24, 2007 by MHz
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