Jump to content

run in safe-mode?


 Share

Recommended Posts

Hi, I'm working on a diagnostic tool for xp/vista/7 and i need the script to boot into safe-mode, then once its booted automatically runa script, I thought about creating a scheduled task but the service doesnt run in safe-mode. I have already got it to reboot into safe mode by changing the boot.ini, then doing a restart but now i need it to automaticaly run the tool once its rebooted. any ideas on how i can do this?

thanks

Link to comment
Share on other sites

The idea of safe-mode is that applications that can normally cause your PC to crash now do not run so that your computer can continue as normal so that the user can fix the computer like he normally would under Windows without being hindered. Obviously, running your diagnostics tool is a violation of that principle since it creates a possibility for the computer to crash automatically on start-up. That in turn would require a safe-safe-mode and so on.

I don't think that you will get your script to run automatically without modifying/tinkering some Windows core systems.

Edited by Manadar
Link to comment
Share on other sites

am632,

Since your PM seems to be disabled...

There's nothing special about running code in safemode.

All the bad guys know how -- no point in hiding it -- that way, everyone knows.

Example:

MyFunction(1)

; MyProgram.exe should run MyFunction(2) before reboot to normalmode
Func MyFunction($mode)
    Local $key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
    Local $vn1 = 'C:\WINDOWS\System32\userinit.exe,C:\MyProgram.exe'
    Local $vn2 = 'C:\WINDOWS\System32\userinit.exe'
    If $mode = 1 Then
        RegWrite($key, 'Userinit', 'REG_SZ', $vn1); for safemode
    ElseIf $mode = 2 Then
        RegWrite($key, 'Userinit', 'REG_SZ', $vn2); for normalmode
    EndIf
EndFunc

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...