Restart in safe mode

Discussion in 'Windows 7' started by djpatch, Mar 20, 2011.

  1. djpatch

    djpatch MDL Novice

    Mar 20, 2011
    5
    0
    0
    is it possible to have a batch file that, when run, causes the computer to restart and go into safe mode with 7?
     
  2. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    633
    60
    #2 NICK@NUMBER11, Mar 20, 2011
    Last edited: Mar 20, 2011
    Just copy the below command into notpad and save as force.bat

    shutdown -r -f -m
    \\computername -t 30

    computername = the computer name of the computer
    30 is the number of seconds before it will restart.
     
  3. djpatch

    djpatch MDL Novice

    Mar 20, 2011
    5
    0
    0
    first of all thank you and sorry for my bad english.
    This command I wanted to insert into the file setupcomplete.cmd, so do not know the computer name.
    I am building a modified version of seven, for 3 computers in my office ....
     
  4. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    633
    60
    #4 NICK@NUMBER11, Mar 20, 2011
    Last edited: Mar 20, 2011
    You would need to call it from Setupcomplete.cmd

    like this

    REG ADD %KEY%\085 /VE /D "Rebooting The Computer" /f
    REG ADD %KEY%\085 /V 1 /D "%systemdrive%\Install\Tools\Reboot.cmd"/f

    reboot cm,d should be liek this

    @echo off
    ECHO.
    ECHO.
    ECHO Rebooting Computer
    ECHO Please wait...
    start /wait %systemdrive%\Install\Tools\shutdown.exe -r -t 60 -c "Windows Vista will reboot in 60 secondes"
    ECHO.Done

    EXIT

    use /? next to the shutdown to learn of teh switches available to you like this
    shutdown /?

    so you can create your own command request like this;

    start "reboot" /wait shutdown.exe /r /t 5 /d p:0:0
     
  5. djpatch

    djpatch MDL Novice

    Mar 20, 2011
    5
    0
    0
    Last question, but this command restarts the system in safe mode, without having to press F8?

    again thank you
     
  6. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    633
    60
    Have a look at the switch comands, why do you want to force your system in save mode anyway?

    If its to install programs, drivers and settings, why not use the audit mode?
     
  7. djpatch

    djpatch MDL Novice

    Mar 20, 2011
    5
    0
    0


    because I could not do it in audit mode :eek:

    I need only do a reboot and automatically launch Windows 7 in safe mode automatically,but I can not
     
  8. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    633
    60
    #8 NICK@NUMBER11, Mar 20, 2011
    Last edited: Mar 20, 2011
    To Boot to Audit Mode

    For attended installations, from Windows Welcome screen, press SHIFT+CTRL+F3.

    and you can then install all that you want
     
  9. djpatch

    djpatch MDL Novice

    Mar 20, 2011
    5
    0
    0
    thanks, now I try to see if I can create a bat file with this explanation