Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Safe Mode and UAC Questions

Simple, Free, Open Source UltraVNC Wrapper Supporting Windows and Mac OSX
FireFerum
Posts: 6
Joined: 2010-03-16 21:41

Safe Mode and UAC Questions

Post by FireFerum »

I spent last night with my brother looking over the Safe Mode reboot. In Vista (UAC turned off previously) and XP, in order to get the server to startup in Safe Mode, a registry key has to be created. I made a batch file for it and then when I tell computer to restart in safe mode with networking, the server's service reconnects. To remove the registry entry we also made another batch file. Is there a place for us to code the commands from the batch files so when the service is created it also automatically runs either the batch file or the one line of code in there? I would assume it would be easier to run the command than include two batch files in the executable. Then, on service/support uninstall, have it also run the removal command which is also only one line of code.

The second question we have is, how can we require the support file to be run as administrator without having to right-click and select run as administrator?
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

FireFerum,

You can have InstantSupport always run as admin by editing SRC\InstantSupport.au3. Add #RequireAdmin as the very first line:

Code: Select all

#RequireAdmin
#include "Aut2Exe\Include\GUIConstantsEx.au3"
#include "Aut2Exe\Include\StaticConstants.au3"
#include "Aut2Exe\Include\WindowsConstants.au3"
So your saying you have safe mode working in both XP and Vista? Would you mind sharing how you did this? I personally don't use safe mode when working on computers remotely but I'm sure others would like this feature.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
FireFerum
Posts: 6
Joined: 2010-03-16 21:41

Re: Safe Mode and UAC Questions

Post by FireFerum »

It's actually pretty easy to get safe mode to work. Basically, safe mode requires the service to start, however, safe mode services are specific to safe mode and have to be added in the SafeBoot registry entry (actually just copy the service from the regular spot to the HKLM/SYSTEM/CurrentControlSet/Control/SafeBoot/Network) That is what my first batch file does.

The tricky part is actually telling the system to reboot in safe mode with networking. That is what I need UAC for. I go to msconfig and selected boot, then safeboot with networking. This modifies the boot.ini file to start in safe mode with networking but requires admin priviledges. If anyone knows of a command to get that done in one line and just create a button for it in the toolbar that would be just awesome. One problem, in Vista, after you are in safe mode and select reboot, it still restarts in safe mode so you have to again go to msconfig and select reboot normally. Would again be nice to see a button at the top that just makes sure the boot.ini is reverted to normal.

Afterwards, on the uninstall of the service and of the support, you just have to delete the service from the SafeBoot/Network since it will no longer exist. That part is a little tricky and I created another batch file to delete that key. Would be nice if I could insert it in the code before compilation if I knew exactly where to add it. If you tell me where to put it, I will test it out and post the code back.

I am going to try that RequireAdmin command right now.
FireFerum
Posts: 6
Joined: 2010-03-16 21:41

Re: Safe Mode and UAC Questions

Post by FireFerum »

#RequireAdmin worked. As soon as the person clicks yes, all commands performed remotely are admin.

When I install the service however, it still prompts me to click yes on everything, but at least it allows me to. I can also run the uninstaller from the desktop all they way through.

Thanks for the help with that part!

EDIT: Turns out that schook.dll gets left behind and the Program Files folder containing the VNC also gets left behind, as does the uninstall shortcut on the desktop. This may be because I am modifying the 3.1d version.
Last edited by FireFerum on 2010-03-16 23:03, edited 1 time in total.
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

Great thanks for the explanation.

schook.dll file gets locked if the viewer isn't closed before the server tries to close.
Someone else told me that the Uninstall link isn't getting deleted but I was unable to replicate....
3.1d is a great addition by Rat but isn't an "official" release so I don't know if that is causing your issues.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
FireFerum
Posts: 6
Joined: 2010-03-16 21:41

Re: Safe Mode and UAC Questions

Post by FireFerum »

So let me understand what you mean by viewer getting closed first. Do I push OK as the viewer on that last 15 seconds warning or does the user push OK after I close my viewer? Also, this happens in Windows 7 if that makes a difference, and is followed by a warning that this program may not have installed correctly.

As a side note, the addition is awesome, but there aren't that many comments on the code so it makes it extremely hard to follow. It's also more complex.
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

Yea, sorry it's not very clear, you don't want to click OK, basically when you see that message it's time for you to close the viewer, in 15 seconds that box goes away and the server is closed/deleted. If you click OK it starts deleting the server immediately which will leave behind schook.dll.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Safe Mode and UAC Questions

Post by B »

Oh. I always thought clicking OK started the 15 second timer, and so I usually waited that long after before restarting things.

By the way, FireFerum, this is amazing that you can get remote control in safe mode! Thanks for sharing. I have decidedly mixed feelings about it; the whole point of Safe Mode is to disallow this kind of thing. At the same time it can certainly come in handy!
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

B,

Basically the message box "Please close the viewer now, uninstall will continue in 15 seconds..." auto closes after 15sec, it's a terrible implementation but fixed the schook.dll lock issue at the time.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Safe Mode and UAC Questions

Post by B »

Maybe just get rid of the OK button then?
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

In 4.0 InstantSupport will tell the viewer to close automatically, no message needed!
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
Bill H
8
8
Posts: 14
Joined: 2008-12-04 20:28
Location: Calgary, Alberta, Canada

Re: Safe Mode and UAC Questions

Post by Bill H »

FireFerum wrote:It's actually pretty easy to get safe mode to work. Basically, safe mode requires the service to start, however, safe mode services are specific to safe mode and have to be added in the SafeBoot registry entry (actually just copy the service from the regular spot to the HKLM/SYSTEM/CurrentControlSet/Control/SafeBoot/Network) That is what my first batch file does.

The tricky part is actually telling the system to reboot in safe mode with networking. That is what I need UAC for. I go to msconfig and selected boot, then safeboot with networking. This modifies the boot.ini file to start in safe mode with networking but requires admin priviledges. If anyone knows of a command to get that done in one line and just create a button for it in the toolbar that would be just awesome. One problem, in Vista, after you are in safe mode and select reboot, it still restarts in safe mode so you have to again go to msconfig and select reboot normally. Would again be nice to see a button at the top that just makes sure the boot.ini is reverted to normal.

Afterwards, on the uninstall of the service and of the support, you just have to delete the service from the SafeBoot/Network since it will no longer exist. That part is a little tricky and I created another batch file to delete that key. Would be nice if I could insert it in the code before compilation if I knew exactly where to add it. If you tell me where to put it, I will test it out and post the code back.

I am going to try that RequireAdmin command right now.
I too have been looking for away to run a UVNC SingleClick as a service in SafeMode. If you are having success with your batch files, would you mind sharing those batch files on the forum. I have been searching to see if I can find info as to the various other RegWrites that must be made along with the RunOnce RegWrite, but what little I have found just doesn't work.

Any light you could shed on this issue would be greatly appreciated.
ccsupport
Posts: 2
Joined: 2010-08-27 18:58

Re: Safe Mode and UAC Questions

Post by ccsupport »

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
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Safe Mode and UAC Questions

Post by B »

Great contribution -- people have been asking about this.

[topic=18818][/topic]

As an aside, does it bother anyone else that it's so easy for applications, including malware, to make themselves run in Safe Mode?
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

I just wanted to give thanks to those who make and support Open Source Software.

You're welcome. :D
Thanks for the contribution as other users were looking for this type of functionality.


As an aside, does it bother anyone else that it's so easy for applications, including malware, to make themselves run in Safe Mode?

Which is why I don't really see the benefit of safe mode.... :|
My feeling on the subject is that any good tech can do without safe mode on a computer that functions well enough to run InstantSupport.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Safe Mode and UAC Questions

Post by B »

I think I disagree. That's like saying that a good tech doesn't need antivirus software because he or she can find and kill processes and files manually. Or that PCs are as safe as Macs because Macs are theoretically vulnerably too. Not all malware goes to the trouble of installing itself in Safe Mode; in fact hardly any does in my experience. So the reality is that it saves some time, at least today. Though I may not be the best judge of time saving diagnostics. :)

Starting in Safe Mode clears a whole lot of clutter away, not just malware but all the extraneous junkware that makes PCs start so slowly.

Safe Mode is still a cleaner way to start, if only because spyware popups are less likely to get in your face while you work.
ccsupport
Posts: 2
Joined: 2010-08-27 18:58

Re: Safe Mode and UAC Questions

Post by ccsupport »

I have to agree with Super-Mod - there are many reasons that you need to boot into safe mode being able to do it remotely is a bonus. Viruses, Rootkits, and malware sometimes the only way to get rid of them is thru safe mode.

With that said I do want to update - I just tried the instant support I created from above example on a Windows 7 computer and it worked flawlessly registering as a service and in the safe mode area.

If now I can only make it come up at the Ctrl-Alt-Del prompt to elimate the user input all together :-D but I'll make due with this.........
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

I think I disagree. That's like saying that a good tech doesn't need antivirus software because he or she can find and kill processes and files manually.

lol, I guess that is what I was saying. That's how I do it. :P
Kill processes, regedit, reboot.
The reason I like to do it this way is because I see so much malware these days that virus scanners don't detect.
If you want to be efficient you have to be able to dive into the registry yourself and know how to get around.


Not all malware goes to the trouble of installing itself in Safe Mode; in fact hardly any does in my experience. So the reality is that it saves some time, at least today. Though I may not be the best judge of time saving diagnostics. :)

I guess experience/skill/whatever comes into play here, I bet I could kill processes, clean up the registry and logoff/logon faster than it would take to boot a computer into safe mode.


So the reality is that it saves some time, at least today. Though I may not be the best judge of time saving diagnostics. :)

I hate waiting for computers, this is why I liquid cool and overclock the heck out of mine. In my shop I even go as far as using 6ft sata cables and IDE adapters because USB is just to slow.


Starting in Safe Mode clears a whole lot of clutter away, not just malware but all the extraneous junkware that makes PCs start so slowly. Safe Mode is still a cleaner way to start, if only because spyware popups are less likely to get in your face while you work

Remember that booting into safe mode puts the drives into PIO mode which severely degrades performance.
If you need a quick "lets make this thing boot faster" temporarily use msconfig or fix the problem in the registry.

The benefit of safe mode would be that it doesn't load hardware drivers. I feel safe mode is only good for booting a computer that is failing to start because of a driver/hardware issue.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
tsume
Posts: 7
Joined: 2006-06-03 16:28

Re: Safe Mode and UAC Questions

Post by tsume »

ccsupport wrote: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

...

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 can confirm this works great on Windows 7. This would be a neat thing to have incorporated into the official release that would put ChunkVNC ahead of some expensive enterprise grade remote support solutions!
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

Fine I'll do it! :P

Even if I don't understand why. ;)
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
KesslerB
Posts: 4
Joined: 2010-09-22 02:32

Re: Safe Mode and UAC Questions

Post by KesslerB »

The safe mode service registry entries work great for XP!

But with windows 7 the service starts in safe mode but a window pops up named "initiate connection" with the fields "Host Name" and "Connection #", both blank.

Any ideas? This is really exciting as I'm in the market for a remote support app and if I can figure out this last hurdle this is perfect.
Last edited by KesslerB on 2010-09-22 02:41, edited 1 time in total.
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

KesslerB,

Windows 7 safe mode with networking or just regular safe mode?
I imagine if you started it without networking that it would do this.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
KesslerB
Posts: 4
Joined: 2010-09-22 02:32

Re: Safe Mode and UAC Questions

Post by KesslerB »

With networking. I use msconfig and set it to boot to safe mode with networking and it works no problem in XP but in win7 I am getting the problem described.
tsume
Posts: 7
Joined: 2006-06-03 16:28

Re: Safe Mode and UAC Questions

Post by tsume »

KesslerB wrote:With networking. I use msconfig and set it to boot to safe mode with networking and it works no problem in XP but in win7 I am getting the problem described.
That's exactly what I'm doing (msconfig, safeboot, networking) and it seems to work. I tried it on both of my PCs. Maybe its because mine are x64?

The only other things I can think I'm doing differently is running the server as admin, using DynDNS for my repeater url, and i am using a different port (5900 instead of 5901 or the other way around, I can't remember) although i doubt any of that would impact this.

I tried advantig oneclick before and got the problem you're describing, but I am not getting that problem with ChunkVNC. At welcome screen in safe mode no prompt comes up, repeater shows Server connected, and Viewer is able to connect.
KesslerB
Posts: 4
Joined: 2010-09-22 02:32

Re: Safe Mode and UAC Questions

Post by KesslerB »

tsume wrote:That's exactly what I'm doing (msconfig, safeboot, networking) and it seems to work. I tried it on both of my PCs. Maybe its because mine are x64?

The only other things I can think I'm doing differently is running the server as admin, using DynDNS for my repeater url, and i am using a different port (5900 instead of 5901 or the other way around, I can't remember) although i doubt any of that would impact this.
I'm running the server and viewer as admin also. I also changed the ports from default and am using dyndns. I'll try again with an x64 win7 and see if that makes a difference.

*edit* Confirmed that it works with my x64 win7 install!! The only thing that comes to mind is that the 32bit install is running on a laptop and has the boot partition encrypted with Truecrypt. I'll test on another 32bit win7 and report back.

This is awesome!! ChunkVNC rules. Supercoe, I think once you make a release available that includes the safe mode feature that word is going to spread quickly.

*edit2* seems it was truecrypt that was causing the problem. Confirmed that I can reconnect in safe mode on win7 x64 and x86. I assume it will work on Vista as well but I'm going to test to make sure.
Last edited by KesslerB on 2010-09-24 04:03, edited 5 times in total.
clayb226
8
8
Posts: 21
Joined: 2010-08-26 09:32

Re: Safe Mode and UAC Questions

Post by clayb226 »

ccsupport wrote: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 just wanted to thank you for this contribution, I now have it up and running great, just the touch I was looking for.
NSNW_Jeff
Posts: 2
Joined: 2011-01-19 21:55

Re: Safe Mode and UAC Questions

Post by NSNW_Jeff »

It doesn't seem this safe mode method has been implimented yet, but I was wondering how I go about manually doing this?

Exactly which file(s) do I need to edit, because I don't see one named "chunkvnc.au3" ?

I see some lines in InstantSupport.au3 which appear to be related, but I'm not sure if I need to add something to the "InstallService" and "RemoveService" functions and/or under the "; Tray events." section where I also see lines related to installing the service.


Any help would be appriciated. I also think this should be added as a feature if it works well.


Thanks!
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Safe Mode and UAC Questions

Post by supercoe »

NSNW_Jeff,

Sorry this is unclear, these instructions were for the now old 3.1 version of ChunkVNC.

I'll be implementing safe mode support into 3.3 which is in the works.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
NSNW_Jeff
Posts: 2
Joined: 2011-01-19 21:55

Re: Safe Mode and UAC Questions

Post by NSNW_Jeff »

Yeah, I was wondering if it was for the old version but figured I better just ask before attempting to edit myself.

That you for the response, and thank you for ChunkVNC! We are testing out and so far it has been working well.

:D
robp2175
Posts: 2
Joined: 2012-11-06 12:27

Re: Safe Mode and UAC Questions

Post by robp2175 »

Was this ever built into 3.3.1. This is the versions I am using and when I installed it as a system service on my brothers machine while he was in Safe Mode I lost the connection to his machine and had to have him restart InstantSupoort.exe. When I looked at the services it had installed but was stopped. Startup Mode was automatic. I have not been able to investigate further, but I assumed that it was not starting because the computer was in Safe Mode. I found this posting when looking for an answer. Any help is appreciated.

If it is NOT built in, I would like to add ccsupports code, but is there a special place within chunkvnc.au3 where the code needs to be placed?
Post Reply