Re: change IE proxy settings
Paul Sobey [PS], on Monday, April 11, 2005 at 15:19 (+0100) wrote about: PS> There will be an API call, but why not put it in a logon script and PS> avoid the necessity for this? If you're doing one-off work use PS> Win32::Internet and work that way... ok, thanks for all replies, after some hour with playing that I come with the working solution: use strict; use warnings; use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 ); use Win32::API; my %proxy_cfg = ( proxy_enable => 1, proxy_host => '10.10.10.10:80', ); my $regpath = 'HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/'; my $p_enable = $regpath . 'ProxyEnable'; my $p_server = $regpath . 'ProxyServer'; $Registry->{$p_enable} = [ pack("L",$proxy_cfg{proxy_enable}), "REG_DWORD" ]; $Registry->{$p_server} = $proxy_cfg{proxy_host} if $proxy_cfg{proxy_enable}; my $InternetSetOption = Win32::API->new("wininet", "InternetSetOption", [qw(N N N N)], 'N'); $InternetSetOption->Call(0, 39, 0, 0) || die "$!\n"; $InternetSetOption->Call(0, 37, 0, 0) || die "$!\n"; print $proxy_cfg{proxy_enable} ? "Proxy enabled to $proxy_cfg{proxy_host}\n" : "Proxy disabled\n"; hope this help to someone :) -- ...m8s, cu l8r, Brano. ["It is possible that Blondes also prefer gentlemen." - Mamie Van Doren.] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: change IE proxy settings
There will be an API call, but why not put it in a logon script and avoid the necessity for this? If you're doing one-off work use Win32::Internet and work that way... P. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ing. Branislav Gerzo (mail-lists) Sent: 11 April 2005 13:01 To: perl-win32-users@listserv.ActiveState.com Subject: Re: change IE proxy settings Paul Sobey [PS], on Monday, April 11, 2005 at 12:39 (+0100) thoughtfully wrote the following: PS> within Active Directory it's easy to apply the policy via the group PS> policy console, but it all ends up as registry keys eventually anyway. I think too. PS> Try modifying these in a logon script or similar: PS> HKCU\Software\Microsoft\windows\CurrentVersion\Internet PS> Settings\ProxyEnable 0x1 PS> HKCU\Software\Microsoft\windows\CurrentVersion\Internet PS> Settings\ProxyServer "server:port" I have set proxu:port in IE, but it is disabled (not checked). Everything I wants is to enable it (check proxy), and I have that in my initial script, just look. But the problem is I don't know how to refresh settings -- ...m8s, cu l8r, Brano. [Orville Bullitt - All the lights don't shine in his marquee.] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Gloucester Research Limited believes the information provided herein is reliable. While every care has been taken to ensure accuracy, the information is furnished to the recipients with no warranty as to the completeness and accuracy of its contents and on condition that any errors or omissions shall not be made the basis for any claim, demand or cause for action. * ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: change IE proxy settings
Paul Sobey [PS], on Monday, April 11, 2005 at 12:39 (+0100) thoughtfully wrote the following: PS> within Active Directory it's easy to apply the policy via the group PS> policy console, but it all ends up as registry keys eventually anyway. I think too. PS> Try modifying these in a logon script or similar: PS> HKCU\Software\Microsoft\windows\CurrentVersion\Internet PS> Settings\ProxyEnable 0x1 PS> HKCU\Software\Microsoft\windows\CurrentVersion\Internet PS> Settings\ProxyServer "server:port" I have set proxu:port in IE, but it is disabled (not checked). Everything I wants is to enable it (check proxy), and I have that in my initial script, just look. But the problem is I don't know how to refresh settings -- ...m8s, cu l8r, Brano. [Orville Bullitt - All the lights don't shine in his marquee.] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: change IE proxy settings
The adm files contain representations of registry settings to be applied. Your best bet here would be to use Win32::TieRegistry to set the appropriate reg key to control IE's proxy settings. If you are within Active Directory it's easy to apply the policy via the group policy console, but it all ends up as registry keys eventually anyway. Try modifying these in a logon script or similar: HKCU\Software\Microsoft\windows\CurrentVersion\Internet Settings\ProxyEnable 0x1 HKCU\Software\Microsoft\windows\CurrentVersion\Internet Settings\ProxyServer "server:port" Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ing. Branislav Gerzo (mail-lists) Sent: 11 April 2005 12:02 To: perl-win32-users@listserv.ActiveState.com Subject: Re: change IE proxy settings $Bill Luebkert [BL], on Friday, April 08, 2005 at 04:52 (-0700) thoughtfully wrote the following: BL> Check out Win32::Internet instead of using the API: I checked it first, but I think this works only in one perl script (make constructor of $INET connection and using it). I'd like to change proxy settings in _real_ IE, so when I run it, I will have changed settings. I'm using another module, which uses real IE. BL> # try something like this instead of API (check docs in Win32::Internet) BL> # you'll have to play with it to get the desired results I assume - I have BL> # no experience with it. BL> my $I = new Win32::Internet('', INTERNET_OPEN_TYPE_PROXY, '') or BL> die "new Win32::Internet: $! ($^E)"; thanks, I tried, no luck. -- ...m8s, cu l8r, Brano. [* <- Tribble = <- Tribble after laying on RR tracks] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs * Gloucester Research Limited believes the information provided herein is reliable. While every care has been taken to ensure accuracy, the information is furnished to the recipients with no warranty as to the completeness and accuracy of its contents and on condition that any errors or omissions shall not be made the basis for any claim, demand or cause for action. * ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: change IE proxy settings
MJG [M], on Friday, April 8, 2005 at 23:07 (-0500) wrote these comments: M> If you have the system.adm file from an active directory server, you can M> see how that sets the value. IF you are using a 200/2003 server not in M> AD, you can apply that adm locally, or just use AD GPOs to keep it M> simple. IF this is your environment to begin with. yes, I have windows 2003 server, no active directory, found D:\WINDOWS\inf\system.adm D:\WINDOWS\system32\GroupPolicy\Adm\system.adm what I should change there ? I didn't found any proxy ip I set in IE. -- ...m8s, cu l8r, Brano. [Now I have friends I never knew were there. - Londo] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: change IE proxy settings
$Bill Luebkert [BL], on Friday, April 08, 2005 at 04:52 (-0700) thoughtfully wrote the following: BL> Check out Win32::Internet instead of using the API: I checked it first, but I think this works only in one perl script (make constructor of $INET connection and using it). I'd like to change proxy settings in _real_ IE, so when I run it, I will have changed settings. I'm using another module, which uses real IE. BL> # try something like this instead of API (check docs in Win32::Internet) BL> # you'll have to play with it to get the desired results I assume - I have BL> # no experience with it. BL> my $I = new Win32::Internet('', INTERNET_OPEN_TYPE_PROXY, '') or BL> die "new Win32::Internet: $! ($^E)"; thanks, I tried, no luck. -- ...m8s, cu l8r, Brano. [* <- Tribble = <- Tribble after laying on RR tracks] ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: change IE proxy settings
If you have the system.adm file from an active directory server, you can see how that sets the value. IF you are using a 200/2003 server not in AD, you can apply that adm locally, or just use AD GPOs to keep it simple. IF this is your environment to begin with. -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 6:52 AM To: Ing. Branislav Gerzo (mail-lists) Cc: perl-win32-users@listserv.ActiveState.com Subject: Re: change IE proxy settings Ing. Branislav Gerzo (mail-lists) wrote: > Hello, > > I have to change IE proxy settings via perl interface. I searched the > web for a long time, found something, coded too, but it doesn't work > :) > > ok, my goal is enable, or disable proxy in IE. Here is code: > > use strict; > use warnings; > use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 ); > use Win32::API; > > #proxy in IE is disabled now > my $regpath = 'HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings/'; > my $penable = $regpath . 'ProxyEnable'; > $Registry->{$penable}= '0x0001'; > print my $pe = $Registry->{$penable}; #prints '0x0001', so value is stored > my $InternetSetOption = Win32::API->new("wininet", "InternetSetOption", [qw(N N N N)], 'N'); > $InternetSetOption->Call(0, 39, 0, 0) || die "$!\n"; > $InternetSetOption->Call(0, 37, 0, 0) || die "$!\n"; Check out Win32::Internet instead of using the API: use strict; use warnings; use Win32::Internet; use Win32::TieRegistry (Delimiter => '/', ArrayValues => 0); # proxy in IE is disabled now my $regpath = 'HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings'; my $penable = "$regpath/ProxyEnable"; my $pe = $Registry->{$penable}; print "pe=$pe\n"; $Registry->{$penable} = '0x0001'; $pe = $Registry->{$penable}; print "pe=$pe\n"; # try something like this instead of API (check docs in Win32::Internet) # you'll have to play with it to get the desired results I assume - I have # no experience with it. my $I = new Win32::Internet('', INTERNET_OPEN_TYPE_PROXY, '') or die "new Win32::Internet: $! ($^E)"; __END__ -- ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: change IE proxy settings
Ing. Branislav Gerzo (mail-lists) wrote: > Hello, > > I have to change IE proxy settings via perl interface. I searched the > web for a long time, found something, coded too, but it doesn't work > :) > > ok, my goal is enable, or disable proxy in IE. Here is code: > > use strict; > use warnings; > use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 ); > use Win32::API; > > #proxy in IE is disabled now > my $regpath = > 'HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet > Settings/'; > my $penable = $regpath . 'ProxyEnable'; > $Registry->{$penable}= '0x0001'; > print my $pe = $Registry->{$penable}; #prints '0x0001', so value is stored > my $InternetSetOption = Win32::API->new("wininet", "InternetSetOption", [qw(N > N N N)], 'N'); > $InternetSetOption->Call(0, 39, 0, 0) || die "$!\n"; > $InternetSetOption->Call(0, 37, 0, 0) || die "$!\n"; Check out Win32::Internet instead of using the API: use strict; use warnings; use Win32::Internet; use Win32::TieRegistry (Delimiter => '/', ArrayValues => 0); # proxy in IE is disabled now my $regpath = 'HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Internet Settings'; my $penable = "$regpath/ProxyEnable"; my $pe = $Registry->{$penable}; print "pe=$pe\n"; $Registry->{$penable} = '0x0001'; $pe = $Registry->{$penable}; print "pe=$pe\n"; # try something like this instead of API (check docs in Win32::Internet) # you'll have to play with it to get the desired results I assume - I have # no experience with it. my $I = new Win32::Internet('', INTERNET_OPEN_TYPE_PROXY, '') or die "new Win32::Internet: $! ($^E)"; __END__ -- ,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[EMAIL PROTECTED] / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ -/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff) ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs