Here is my personal batch file that works it's magic to reboot the system into safemode with networking, and then revert the changes using runonce:
Code: Select all
Echo Off
REM Check Windows Version
ver | findstr /i "5\.0\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_nt5x
ver | findstr /i "5\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_nt5x
ver | findstr /i "5\.2\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_nt5x
ver | findstr /i "6\.0\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_nt6x
ver | findstr /i "6\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto ver_nt6x
goto warn_and_exit
:ver_nt5x
:Run Windows 2000/XP specific commands here
bootcfg /raw /a /safeboot:network /id 1
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v "*UndoSB" /t REG_SZ /d "bootcfg /raw /fastdetect /id 1"
SHUTDOWN -r -f -t 01
goto end
:ver_nt6x
:Run Windows Vista/7 specific commands here
bcdedit /set {current} safeboot network
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v "*UndoSB" /t REG_SZ /d "bcdedit /deletevalue {current} safeboot"
SHUTDOWN -r -f -t 01
goto end
Echo On
:warn_and_exit
echo Machine OS cannot be determined.
:end
Code: Select all
I just wanted to give thanks to those who make and support Open Source Software. I also wanted to contribute a little here, since remote support sometimes takes you in safe mode and that is a very specific thing I was looking for based on another users info I was able to modify the chunkvnc.au3 script with the following commands to add into safe mode under the registry as well as take it away
Here it is
; Install service.
ShellExecute( $ChunkVNCPath & "\InstantSupportVNC.exe","-install" )
shellExecute("reg.exe","add HKLM\System\CurrentControlSet\Control\SafeBoot\Network\uvnc_service /VE /T REG_SZ /F /D Service","%systemroot%\system32")
; Remove files.
_SelfDelete(5)
Else
If MsgBox( 4, "ChunkVNC", "Remove Service and Uninstall?" ) = 6 Then
; Allow viewer to disconnect to prevent schook.dll locking.
MsgBox( 0, "Information", "Please close the viewer now, uninstall will continue in 15 seconds...", 15 )
; Uninstall service.
ShellExecute( $ChunkVNCPath & "\InstantSupportVNC.exe", "-uninstall" )
shellExecute("reg.exe","delete HKLM\System\CurrentControlSet\Control\SafeBoot\Network\uvnc_service /F","%systemroot%\system32")
using the reg add command and the reg delete command - I don't know yet if it works in Windows Vista and 7 but does in XP