Darkonen Posted September 11, 2005 Posted September 11, 2005 Hi i'm trying to make a script that will restart the computer in safe mode with network. The only way i have found is editing boot.ini. Is there any other way to restart in save mode?
Darkonen Posted September 11, 2005 Author Posted September 11, 2005 I'm trying to open the msconfig program, there i can config to restart in safe mode, but it is unable to open msconfig i've tried: run("msconfig.exe") run("%systemroot%/servipackfiles/msconfig.exe") any ideas?
PerryRaptor Posted September 11, 2005 Posted September 11, 2005 (edited) Need to use the AutoIT Macro @WindowsDir to get the Drive Letter and Folder Name for where Windows is installed...$Location="\ServicePackFiles\i386\" $App2Run="Msconfig.exe" RunWait(@WindowsDir & $location & $app2Run)Please post your questions and request troubleshooting in the Support area of the forum please. Edited September 11, 2005 by PerryRaptor
Dickb Posted September 11, 2005 Posted September 11, 2005 I'm trying to open the msconfig program, there i can config to restart in safe mode, but it is unable to open msconfig i've tried:run("msconfig.exe")run("%systemroot%/servipackfiles/msconfig.exe")any ideas?<{POST_SNAPBACK}>When I do a search on my harddisk then I find msconfig.exe on 2 places (WinXP Pro SP2):%systemroot%\System32\dllcache\msconfig%systemroot%\pchealth\helpctr\binaries\msconfigAnd this will run msconfig on my computer.Both lines in this example work (for me at least)RunWait("cmd.exe /c %systemroot%\pchealth\helpctr\binaries\msconfig.exe", "", @SW_HIDE) RunWait(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe")For the first method I had to use the "cmd.exe /c" to get it working.
Darkonen Posted September 11, 2005 Author Posted September 11, 2005 (edited) I made this script that restarts in safe mode with network, any ideas to optimize it? I think it can be done better and how to be able to run on diferent windows languages, i'vet got spanish version Run(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe") WinWait("Utilidad de configuración del sistema") ControlClick("Utilidad de configuración del sistema","", 1010) send("{ENTER}") winWaitActive("Configuración del sistema") ControlClick("Configuración del sistema","", 2) Run(@WindowsDir & "\pchealth\helpctr\binaries\msconfig.exe") WinWait("Utilidad de configuración del sistema") Send("^{TAB}") Send("^{TAB}") Send("^{TAB}") ControlClick("Utilidad de configuración del sistema","", 216) ControlClick("Utilidad de configuración del sistema","", 222) ;ControlClick("Utilidad de configuración del sistema","", 1) send("{ENTER}") winWaitActive("Configuración del sistema") ControlClick("Configuración del sistema","", 2) Edited September 11, 2005 by Darkonen
PerryRaptor Posted September 11, 2005 Posted September 11, 2005 (edited) here is an idea for a different way of booting into Safe Mode with Networking:1. Create a script that will edit the file Boot.ini entry that looks something like this:multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn to:multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /SafeBoot:Network 2. Drop your compiled script into "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\" folder for execution when someone logs onto the computer. We will name this script "SafeMode" for clarity.3. Near the end of your "Safe Mode" script have it rewrite the Boot.ini line setting it back to the way it was.4. Create a method to delete the Safe Mode script. I have the idea of creating a "StepTwo" that is stored in a Temp Folder. The Safe Mode script merely calls the StepTwo script and terminates. That way the last line in the StepTwo script can delete the Safe Mode script so that it does not run after rebooting.Edit: SafeMode will not auto launch anything in the Startup folder mentioned above, so don't waste your time. Edited September 11, 2005 by PerryRaptor
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