05-07-2012 02:50 AM
I have a question regarding starting a program through Access Connections. I would like to know which account does AC uses to start a program defined under "Additional Setting" --> ""Start Applications automatically"?
I'm asking this because I've made myself a VBScript that checks which location is active and maps network drives, changes Firewall options and last changes proxy settings. Why do I use script for proxy changes and not AC option? Because Windows Live 2011 and JDownloader (among some other applications) in some cases ignore IE Proxy settings and do not work without setting proxy using "netsh winhttp" command.
My problem is, when I run script in debug mode it works perfectly, when I run it form explorer it runs perfectly, BUT when AC starts it everything works except registry change for proxy! So I though if AC runs applications as SYSTEM, or some other user I could try to give rights to that user for registry entry I need to change.
07-06-2012 05:21 AM
As far as I know, AC runs the programs in logged in user's account. If its Windows-7, then maybe the UAC is preventing registry write operations in your vbscript. Is it possible for your to post the vbscript portion [which doesnt work for you], so that I can do further investigation?
08-14-2012 01:49 AM
I'm sorry for this late reply (sick leave, holidays, etc). Regarding AC runs issue:
a) OS is Windows 7 x64
b) I'm logged in to my computer as Domain Admin
c) UAC is turned off (via User accounts and Security policy)
Here is a portion of my script:
**Here goes a part of script which checks what profile is started, sets some variables and call subs
Sub XWIRED (this is my generic LAN connection to ADSL router with DHCP)
Call rd_drives -- removes all mapped network drives from previous connections
WScript.Sleep 5000 -- give a script some time to finish previous operations
strBINARYValue3 = Array (40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0) -- set the value for Winhttp -set proxy command
Call Proxy -- call change proxy sub
Call Firewall -- call firewall options sub
strKeyPath3 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections"
strBINARYValueName3 = "WinHttpSettings"
oReg.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath3, strBINARYValueName3, strBINARYValue3
Now, everything in this scripts works (removing mapped drives, setting new ones, setting firewall options, etc.) except setting proxy. I tried to use standard run command inside this script which would call "netsh winhttp set proxy" or "netsh winhttp reset proxy" but I switched to this new option.
As I described, if I manually start this script everything works, if AC starts it proxy part of it doesn't work (no changes made). I can't debug it (it works if started as user in Primal debug mode).
For now I have vbs on my desktop and run it every time I change connections, but I would like to automate it because sometimes I forget to run it (and my job description requires me to switch from location to location).
08-16-2012 05:45 AM
I could reproduce the issue you see. The script is trying to modify a registry data in HKEY_LOCAL_MACHINE area. Access connections runs 'startup applications' in logged in user context but with restricted permissions [ie UAC is turned ON] and so the script fails to perform any operations that requires Administrative privilege. I beleive that Access connections is doing this for seciurity reasons, to avoid any misuse by end user for modifying system settungs via Access Connections.
Is it possible to use any registry under HKCU branch?
08-16-2012 06:11 AM
My script is called via bat file which has only one line cscript scriptname.vbs. I tried to set "Run as Administrator" on that bat file but it didn't help. My script also has one other sub for firewall settings and it is also HKLM setting and that one works. As I said UAC is disabled, I'm logged in as local admin (tried as domain admin).
Why am I using this setting? It's not proxy setting (proxy is set via build-in option inside AC for each profile) but some of the applications ignore proxy setting and use internal WinHTTP setting (some Chrome extensions, MSN, GTalk...). This is the reason I need to use this option.
First option was to use vbs run command to execute "netsh" but that one didn't work also even when started as user outside of AC.
Regarding HKCU I think this WinHTTP setting is computer level defined.
08-16-2012 06:46 AM - edited 08-16-2012 06:52 AM
I understand what you are trying to do. I'm not sure why you are able to modify firewall registry data under HKLM but on my machine script fails to modify any registry under HKLM area when its launched indirectly via batch file through AC [Access Connections]. And this is definitely a limitation with current AC version.
I did find a work around as below and you may give it a try. I do agree that its not a simple work around.
1) Open task manager and goto "processes" tab.
2) Kill explorer.exe process
3) Switch to 'Applications' tab and click on 'New task'
4) Type in explorer.exe and check the checkbox for "Create this task with administrative privileges'
5) After explorer launches, press CTRL+ALT+DEL
6) click on "lock this computer"
7) unlock the screen
Now the explorer process is launched with maximum permissions allowed for current user. During lock/unlock, AC knows that new explorer process has been launched. AC uses this new explorer process context while launching the startup application next time onwards.
Now try to apply any AC profile and check if HKLM area can be modified by your script or not.