Reboot to Safemode with Networking Feature

Simple, Free, Open Source UltraVNC Wrapper Supporting Windows and Mac OSX.

Reboot to Safemode with Networking Feature

Postby ChunkDog » 2012-08-02 22:09

I'm starting this topic to hopefully integrate a Reboot to Safemode with Netowrking option tested and working fully. I will break this down into 2 parts. This first part is my own work of a batch file to make the reboot to safemode magic happen. I believe all the batch commmands could easily be translated into AutoIt script, with the proper know how (Which I dont quite have). The second part is the work of another forum member "ccsupport" and his excellent safemode service entries for VNC server to run in safemode as a service. I look forward to getting this fully implemented and working for us all, but need your guys help, since AutoIt scripting is not something I'm very familiar with, but batch scripting I'am.


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


Here is ccsupports contribution to safemode vnc service:

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


I'm not quite sure the proper way to integrate this into the current chunkvnc project as it stands. All feedback is greatly appreciated. I have successfuly tested this batch file on all versions of Windows from XP up to Windows 7, but the only concern to me would be a dual boot scenario, since the batch files only change to default OS and do not consider another boot option other than default.
Last edited by ChunkDog on 2012-08-03 17:42, edited 1 time in total.
ChunkDog
 
Posts: 1
Joined: 2011-10-12 02:31

Re: Reboot to Safemode with Networking Feature

Postby supercoe » 2012-08-03 15:55

Wow cool stuff, thanks for contributing to the project. :)
I'll take a look at integrating this as this project is loooooooooong over due for an update anyways!

Which operating systems have you tested this with so far?
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
User avatar
supercoe
Super-Mod
Super-Mod
 
Posts: 1735
Joined: 2009-07-20 21:27
Location: Walker, MN

Re: Reboot to Safemode with Networking Feature

Postby Sainsuper » 2012-08-07 15:48

reboot in safe mode is native in Ultravnc installed as service. You only should show icon ;)
Sainsuper
40
40
 
Posts: 74
Joined: 2008-04-02 10:47

Re: Reboot to Safemode with Networking Feature

Postby supercoe » 2012-08-07 16:22

InstantSupport hides the UltraVNC Server icon and AFAIK there wasn't a way to achieve it's feature through command line which is why we need a different work around. :)
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
User avatar
supercoe
Super-Mod
Super-Mod
 
Posts: 1735
Joined: 2009-07-20 21:27
Location: Walker, MN

Re: Reboot to Safemode with Networking Feature

Postby robp2175 » 2012-11-06 13:37

Is there a specific place within the chunkvnc.au3 file where I need to put ccsupports code??
robp2175
 
Posts: 2
Joined: 2012-11-06 12:27

Re: Reboot to Safemode with Networking Feature

Postby supercoe » 2012-11-06 18:13

Sorry, your on your own getting this to work. It would be to much of a burden on me to help support ChunkVNC modifications, I hope you understand. :)
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
User avatar
supercoe
Super-Mod
Super-Mod
 
Posts: 1735
Joined: 2009-07-20 21:27
Location: Walker, MN


Return to ChunkVNC

Who is online

Users browsing this forum: No registered users and 1 guest