Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Modding Registry Problems

Reply
 
Old 10-25-2007   #1 (permalink)
Kryten


 
 

Modding Registry Problems

Hi,
I'm trying to develop a startup PS script that will automatically
spawn IE and navigate to a certain web site. So far so easy. It turns
out that for the clients to then log in and use all the functionality
of that web site I they need to use a proxy server in IE.

I thought it would be trivial to adapt the PS script to add the proxy
settings into the registry - and it probably is, but being a PS newbie
I'm getting a bit lost.

The reg keys I need to change are at:-

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings

and are
ProxyEnable = 1
ProxyServer = "proxy.com:8080"

In PS I can manually navigate as far as HKEY_CURRENT_USER\Software
\Microsoft\Windows\CurrentVersion

and when I dir I can see:-
SKC VC Name Property
--- -- ---- --------
1 1 App Management {ShowUpdates}
6 0 Applets {}
0 2 Controls Folder {Presentation LCID,
Presentation Cache}
37 19 Explorer {WebFindBandHook,
FileFindBandHook, Logon
2 0 Ext {}
0 4 Extensions {doc, dot, rtf, xls}
3 0 Group Policy {}
2 0 Group Policy Objects {}
1 1 GrpConv {Log}
0 0 Internet {}
12 32 Internet Settings {User Agent,
IE5_UA_Backup_Flag, NoNetAut
1 0 Multimedia {}
8 1 Policies {MemCheckBoxInRunDlg}
0 3 Run {ctfmon.exe, RocketDock,
DrvMon.exe}
0 0 RunOnce {}
1 0 Settings {}
2 0 Shell Extensions {}
1 0 Syncmgr {}
3 0 Telephony {}
0 2 ThemeManager {WCreatedUser, ThemeActive}
3 5 Themes {InstallTheme,
InstallVisualStyle, Instal
0 0 Uninstall {}
1 2 Webcheck {NoChannelLogging,
NoScheduledUpdates}
0 0 WindowsUpdate {}
1 0 WinTrust {}

So I know that I'm in the right place, but I cannot seem to cd into
Internet Settings or get "at" the contents, where I need to read/write
the required values.

Any help appreciated!

Thank,
Stuart


My System SpecsSystem Spec
Old 10-25-2007   #2 (permalink)
Shay Levi


 
 

Re: Modding Registry Problems

Try:

set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet
Settings' -name ProxyEnable -value 1
set-itemproperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet
Settings' -name ProxyServer -value "proxy.com:8080"


Shay
http://scriptolog.blogspot.com


Quote:

> Hi,
> I'm trying to develop a startup PS script that will automatically
> spawn IE and navigate to a certain web site. So far so easy. It turns
> out that for the clients to then log in and use all the functionality
> of that web site I they need to use a proxy server in IE.
> I thought it would be trivial to adapt the PS script to add the proxy
> settings into the registry - and it probably is, but being a PS newbie
> I'm getting a bit lost.
>
> The reg keys I need to change are at:-
>
> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
> Settings
>
> and are
> ProxyEnable = 1
> ProxyServer = "proxy.com:8080"
> In PS I can manually navigate as far as HKEY_CURRENT_USER\Software
> \Microsoft\Windows\CurrentVersion
>
> and when I dir I can see:-
> SKC VC Name Property
> --- -- ---- --------
> 1 1 App Management {ShowUpdates}
> 6 0 Applets {}
> 0 2 Controls Folder {Presentation LCID,
> Presentation Cache}
> 37 19 Explorer {WebFindBandHook,
> FileFindBandHook, Logon
> 2 0 Ext {}
> 0 4 Extensions {doc, dot, rtf, xls}
> 3 0 Group Policy {}
> 2 0 Group Policy Objects {}
> 1 1 GrpConv {Log}
> 0 0 Internet {}
> 12 32 Internet Settings {User Agent,
> IE5_UA_Backup_Flag, NoNetAut
> 1 0 Multimedia {}
> 8 1 Policies {MemCheckBoxInRunDlg}
> 0 3 Run {ctfmon.exe, RocketDock,
> DrvMon.exe}
> 0 0 RunOnce {}
> 1 0 Settings {}
> 2 0 Shell Extensions {}
> 1 0 Syncmgr {}
> 3 0 Telephony {}
> 0 2 ThemeManager {WCreatedUser, ThemeActive}
> 3 5 Themes {InstallTheme,
> InstallVisualStyle, Instal
> 0 0 Uninstall {}
> 1 2 Webcheck {NoChannelLogging,
> NoScheduledUpdates}
> 0 0 WindowsUpdate {}
> 1 0 WinTrust {}
> So I know that I'm in the right place, but I cannot seem to cd into
> Internet Settings or get "at" the contents, where I need to read/write
> the required values.
>
> Any help appreciated!
>
> Thank,
> Stuart

My System SpecsSystem Spec
Old 10-25-2007   #3 (permalink)
Jeff


 
 

Re: Modding Registry Problems

On Oct 25, 6:26 pm, Kryten <Kryte...@xxxxxx> wrote:
Quote:

> Hi,
> I'm trying to develop a startup PS script that will automatically
> spawn IE and navigate to a certain web site. So far so easy. It turns
> out that for the clients to then log in and use all the functionality
> of that web site I they need to use a proxy server in IE.
>
> I thought it would be trivial to adapt the PS script to add the proxy
> settings into the registry - and it probably is, but being a PS newbie
> I'm getting a bit lost.
>
> The reg keys I need to change are at:-
>
> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
> Settings
>
> and are
> ProxyEnable = 1
> ProxyServer = "proxy.com:8080"
>
> In PS I can manually navigate as far as HKEY_CURRENT_USER\Software
> \Microsoft\Windows\CurrentVersion
>
> and when I dir I can see:-
> SKC VC Name Property
> --- -- ---- --------
> 1 1 App Management {ShowUpdates}
> 6 0 Applets {}
> 0 2 Controls Folder {Presentation LCID,
> Presentation Cache}
> 37 19 Explorer {WebFindBandHook,
> FileFindBandHook, Logon
> 2 0 Ext {}
> 0 4 Extensions {doc, dot, rtf, xls}
> 3 0 Group Policy {}
> 2 0 Group Policy Objects {}
> 1 1 GrpConv {Log}
> 0 0 Internet {}
> 12 32 Internet Settings {User Agent,
> IE5_UA_Backup_Flag, NoNetAut
> 1 0 Multimedia {}
> 8 1 Policies {MemCheckBoxInRunDlg}
> 0 3 Run {ctfmon.exe, RocketDock,
> DrvMon.exe}
> 0 0 RunOnce {}
> 1 0 Settings {}
> 2 0 Shell Extensions {}
> 1 0 Syncmgr {}
> 3 0 Telephony {}
> 0 2 ThemeManager {WCreatedUser, ThemeActive}
> 3 5 Themes {InstallTheme,
> InstallVisualStyle, Instal
> 0 0 Uninstall {}
> 1 2 Webcheck {NoChannelLogging,
> NoScheduledUpdates}
> 0 0 WindowsUpdate {}
> 1 0 WinTrust {}
>
> So I know that I'm in the right place, but I cannot seem to cd into
> Internet Settings or get "at" the contents, where I need to read/write
> the required values.
>
> Any help appreciated!
>
> Thank,
> Stuart
This works just fine for me:

# example #
Push-Location

Set-Location 'HKCU:\Software\Microsoft\Windows'
Set-Location 'CurrentVersion\Internet Settings'

Set-ItemProperty -Path . `
-Name ProxyEnable `
-Value 1

Set-ItemProperty -Path . `
-Name ProxyServer `
-Value "proxy.com:8080"

Pop-Location
# example #

Jeff

My System SpecsSystem Spec
Old 10-25-2007   #4 (permalink)
Kryten


 
 

Re: Modding Registry Problems

Jeff and Shay,
Thanks for the responses. Both suggestions work just fine with next to
no modification needed to fit either one into my startup script.
Thing is, I was under the impression that PS treated the reg like a
drive and was able to cd into each successive layer all the way down
from HKCU .. cd Software .. cd Microsoft etc etc all the way down to
CurrentVersion but could not cd into INTERNET SETTINGS. So I began
trying
to $ie = get-itemproperty -Path . -item Internet Settings
but all to no avail.


I guess what I am asking is how, from PS, do you even see the contents
of the Internet Settings Sub Key?

Thanks,
Stuart

My System SpecsSystem Spec
Old 10-25-2007   #5 (permalink)
Kryten


 
 

Re: Modding Registry Problems

Here is what I mean:-
PS HKCU:\Software\Microsoft\Windows\CurrentVersion> dir


Hive: Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software
\Microsoft\Windows\C

SKC VC Name Property
--- -- ---- --------
1 1 App Management {ShowUpdates}
6 0 Applets {}
0 2 Controls Folder {Presentation LCID,
Presentation Cache}
37 19 Explorer {WebFindBandHook,
FileFindBandHook, Logon User Name,
2 0 Ext {}
0 4 Extensions {doc, dot, rtf, xls}
3 0 Group Policy {}
2 0 Group Policy Objects {}
1 1 GrpConv {Log}
0 0 Internet {}
12 32 Internet Settings {User Agent,
IE5_UA_Backup_Flag, NoNetAutodial, Migr
1 0 Multimedia {}
8 1 Policies {MemCheckBoxInRunDlg}
0 3 Run {ctfmon.exe, RocketDock,
DrvMon.exe}
0 0 RunOnce {}
1 0 Settings {}
2 0 Shell Extensions {}
1 0 Syncmgr {}
3 0 Telephony {}
0 2 ThemeManager {WCreatedUser, ThemeActive}
3 5 Themes {InstallTheme,
InstallVisualStyle, InstallVisualStyl
0 0 Uninstall {}
1 2 Webcheck {NoChannelLogging,
NoScheduledUpdates}
0 0 WindowsUpdate {}
1 0 WinTrust {}


PS HKCU:\Software\Microsoft\Windows\CurrentVersion> Set-Location
Internet Settings
Set-Location : A parameter cannot be found that matches parameter name
'Settings'.
At line:1 char:13
+ Set-Location <<<< Internet Settings

Any thoughts?

Stuart


My System SpecsSystem Spec
Old 10-25-2007   #6 (permalink)
Kirk Munro


 
 

Re: Modding Registry Problems

Hi Kryten,

You need to put "Internet Settings" in quotation marks. Otherwise the
PowerShell interpreter treats the words Internet and Settings as separate
parameters and since it cannot find a match for the Settings parameter, it
raises an error.

-
Kirk Munro
Poshoholic
http://poshoholic.com

"Kryten" <Kryten68@xxxxxx> wrote in message
news:1193329795.231864.170440@xxxxxx
Quote:

> Here is what I mean:-
> PS HKCU:\Software\Microsoft\Windows\CurrentVersion> dir
>
>
> Hive: Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software
> \Microsoft\Windows\C
>
> SKC VC Name Property
> --- -- ---- --------
> 1 1 App Management {ShowUpdates}
> 6 0 Applets {}
> 0 2 Controls Folder {Presentation LCID,
> Presentation Cache}
> 37 19 Explorer {WebFindBandHook,> FileFindBandHook,
> Logon User Name,
> 2 0 Ext {}
> 0 4 Extensions {doc, dot, rtf, xls}
> 3 0 Group Policy {}
> 2 0 Group Policy Objects {}
> 1 1 GrpConv {Log}
> 0 0 Internet {}
> 12 32 Internet Settings {User Agent,
> IE5_UA_Backup_Flag, NoNetAutodial, Migr
> 1 0 Multimedia {}
> 8 1 Policies {MemCheckBoxInRunDlg}
> 0 3 Run {ctfmon.exe, RocketDock,
> DrvMon.exe}
> 0 0 RunOnce {}
> 1 0 Settings {}
> 2 0 Shell Extensions {}
> 1 0 Syncmgr {}
> 3 0 Telephony {}
> 0 2 ThemeManager {WCreatedUser, ThemeActive}
> 3 5 Themes {InstallTheme,
> InstallVisualStyle, InstallVisualStyl
> 0 0 Uninstall {}
> 1 2 Webcheck {NoChannelLogging,
> NoScheduledUpdates}
> 0 0 WindowsUpdate {}
> 1 0 WinTrust {}
>
>
> PS HKCU:\Software\Microsoft\Windows\CurrentVersion> Set-Location
> Internet Settings
> Set-Location : A parameter cannot be found that matches parameter name
> 'Settings'.
> At line:1 char:13
> + Set-Location <<<< Internet Settings
>
> Any thoughts?
>
> Stuart
>
>

My System SpecsSystem Spec
Old 10-25-2007   #7 (permalink)
Kirk Munro


 
 

Re: Modding Registry Problems

One more thing Stuart. Just to close the loop on your other question about
how to get the values associated with a given key, you can do this:

Set-Location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet
Settings"
$currentRegKey = Get-Item .
Write-Host "Values for" $currentRegKey.Name
$currentRegKey.GetValueNames() | ForEach-Object {
$value = $currentRegKey.GetValue($_)
Write-Host $_ "=" $value
}

This will output something similar to the following:

Values for
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings
User Agent = Mozilla/4.0 (compatible; MSIE 6.0; Win32)
IE5_UA_Backup_Flag = 5.0
NoNetAutodial = 0
MigrateProxy = 1
EnableNegotiate = 1
ProxyEnable = 0
WarnOnZoneCrossing = 0
PrivacyAdvanced = 0
EmailName = IEUser@
AutoConfigProxy = wininet.dll
MimeExclusionListForCache = multipart/mixed multipart/x-mixed-replace
multipart/x-byteranges
WarnOnPost = 1 0 0 0
UseSchannelDirectly = 1 0 0 0
EnableHttp1_1 = 1

-
Kirk Munro
Poshoholic
http://poshoholic.com

"Kirk Munro" <sorry@xxxxxx> wrote in message
news:eNu5Fe0FIHA.1204@xxxxxx
Quote:

> Hi Kryten,
>
> You need to put "Internet Settings" in quotation marks. Otherwise the
> PowerShell interpreter treats the words Internet and Settings as separate
> parameters and since it cannot find a match for the Settings parameter, it
> raises an error.
>
> -
> Kirk Munro
> Poshoholic
> http://poshoholic.com
>
> "Kryten" <Kryten68@xxxxxx> wrote in message
> news:1193329795.231864.170440@xxxxxx
Quote:

>> Here is what I mean:-
>> PS HKCU:\Software\Microsoft\Windows\CurrentVersion> dir
>>
>>
>> Hive: Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software
>> \Microsoft\Windows\C
>>
>> SKC VC Name Property
>> --- -- ---- --------
>> 1 1 App Management {ShowUpdates}
>> 6 0 Applets {}
>> 0 2 Controls Folder {Presentation LCID,
>> Presentation Cache}
>> 37 19 Explorer {WebFindBandHook,>
>> FileFindBandHook, Logon User Name,
>> 2 0 Ext {}
>> 0 4 Extensions {doc, dot, rtf, xls}
>> 3 0 Group Policy {}
>> 2 0 Group Policy Objects {}
>> 1 1 GrpConv {Log}
>> 0 0 Internet {}
>> 12 32 Internet Settings {User Agent,
>> IE5_UA_Backup_Flag, NoNetAutodial, Migr
>> 1 0 Multimedia {}
>> 8 1 Policies {MemCheckBoxInRunDlg}
>> 0 3 Run {ctfmon.exe, RocketDock,
>> DrvMon.exe}
>> 0 0 RunOnce {}
>> 1 0 Settings {}
>> 2 0 Shell Extensions {}
>> 1 0 Syncmgr {}
>> 3 0 Telephony {}
>> 0 2 ThemeManager {WCreatedUser, ThemeActive}
>> 3 5 Themes {InstallTheme,
>> InstallVisualStyle, InstallVisualStyl
>> 0 0 Uninstall {}
>> 1 2 Webcheck {NoChannelLogging,
>> NoScheduledUpdates}
>> 0 0 WindowsUpdate {}
>> 1 0 WinTrust {}
>>
>>
>> PS HKCU:\Software\Microsoft\Windows\CurrentVersion> Set-Location
>> Internet Settings
>> Set-Location : A parameter cannot be found that matches parameter name
>> 'Settings'.
>> At line:1 char:13
>> + Set-Location <<<< Internet Settings
>>
>> Any thoughts?
>>
>> Stuart
>>
>>
>
>

My System SpecsSystem Spec
Old 10-25-2007   #8 (permalink)
Steven Hystad


 
 

Re: Modding Registry Problems

You'll need to use quotes when there is a space in any parameter.
e.g.:
PS HKCU:\Software\Microsoft\Windows\CurrentVersion> Set-Location "Internet
Settings"

"Kryten" <Kryten68@xxxxxx> wrote in message
news:1193329795.231864.170440@xxxxxx
Quote:

> PS HKCU:\Software\Microsoft\Windows\CurrentVersion> Set-Location
> Internet Settings
> Set-Location : A parameter cannot be found that matches parameter name
> 'Settings'.
> At line:1 char:13
> + Set-Location <<<< Internet Settings
My System SpecsSystem Spec
Old 10-26-2007   #9 (permalink)
Kryten


 
 

Re: Modding Registry Problems

Superb!
Thank You,
Stuart


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Solved [Solution] Modding boot screen with Vista SP1 (32 & 64 bit) General Discussion
CD ROM / Registry problems Vista performance & maintenance
Modding TCPIP.sys Network & Sharing
Registry Problems Vista General
registry problems in RC2.... Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46