Link to home
Start Free TrialLog in
Avatar of DRRAM
DRRAM

asked on

IE script .bat

An someone please tell me or make me a script .bat that will turn proxy on  for IE explorer in xp?

My proxy is "PROXY xx.xx.xx.xx:8080"
and exception xx.xx.*

Thanks
Avatar of Myth_Buster
Myth_Buster

You first need to create a reg file with the following content:

Regedit4
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MigrateProxy"=dword:00000001
"ProxyEnable"=dword:00000001
"ProxyHttp1.1"=dword:00000000
"ProxyServer"="http://ProxyServerName:80"
"ProxyOverride"="<local>"

Replace the ProxyServerName above with the name or IP of your Proxy Server.
Also, A reg file is just a text file with a .reg extension.
Name the reg file anything you like with the .reg extension.
In your .bat script add the following line:
regedit /s regfile.reg

That line tells regedit to silently import the registry settings in the file specified.

Note: You will need to include the FULL path to the location of the .reg file.

Cheers
Avatar of DRRAM

ASKER

Please can you check the two files (attached) and please is possible to make a single file instead of the two files

Thanks
ie.bat.txt
regfile.reg.txt
I edited the spaces out and attached.
Also, I noticed the full path you had to the regfile was D:\ (a local drive).
If you plan on copying the regfile to every computer that may be ok.
But if your .bat is in a network share, you should copy the regfile there also.
Then the path to the reg file would be \\computername\sharefolder\regfile.reg.

Is there a network server? If so, is it a domain controller?
If so, you could use policies for all this instead of the batch script.

Cheers


regfile.reg.txt
ie.bat.txt
Avatar of DRRAM

ASKER

PLEASE So it's not possible to put them in the same file
LOL put this in your .bat file and forget about the regfile:

REG ADD HKLM\Software\HackersAreUs /f
REG ADD HKLM\Software\HackersAreUs /v MigrateProxy /t reg_dword /d 00000001 /f
REG ADD HKLM\Software\HackersAreUs /v ProxyEnable /t reg_dword /d 00000001 /f
REG ADD HKLM\Software\HackersAreUs /v ProxyHTTP1.1 /t reg_dword /d 00000000 /f
REG ADD HKLM\Software\HackersAreUs /v ProxyServer /t reg_multi_sz /d http://ProxyServer:80 /f
REG ADD HKLM\Software\HackersAreUs /v ProxyOverride /t reg_multi_sz /d 192.168.1.1,192.168.2.* /f

Cheers
Whoops... forgot to change the reg key paths...
Here ya go:

REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v MigrateProxy /t reg_dword /d 00000001 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v ProxyEnable /t reg_dword /d 00000001 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v ProxyHTTP1.1 /t reg_dword /d 00000000 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v ProxyServer /t reg_multi_sz /d http://ProxyServer:80 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v ProxyOverride /t reg_multi_sz /d 192.168.1.1,192.168.2.* /f

Cheers
Avatar of DRRAM

ASKER

Please when launching the file (attached) I have many errors I have attached the image.
Thank you

IE-F.bat.txt
script-erreur.bmp
Every "REG ADD" command is one line of...
I attached what it should look like.
Also, I noticed your kernel is in a nother language...
... There are specific times when you will need to convert the text from Eng to the language of your kernel.
I think this should work in english though...
ie.bat.txt
Avatar of DRRAM

ASKER

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

U:\>"C:\Documents and Settings\EEEE\Bureau\ie.bat"

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /f


Erreur : too many command line parameters

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v
MigrateProxy /t reg_dword /d 00000001 /f

Erreur : too many command line parameters

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v
ProxyEnable /t reg_dword /d 00000001 /f

Erreur : too many command line parameters

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v
ProxyHTTP1.1 /t reg_dword /d 00000000 /f

Erreur : too many command line parameters

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v
ProxyServer /t reg_multi_sz /d http://ProxyServer:80 /f

Erreur : too many command line parameters

U:\>REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings /v
ProxyOverride /t reg_multi_sz /d 192.168.1.1,192.168.2.* /f

Erreur : too many command line parameters
Avatar of johnb6767
Missing quotes..... "Internet Settings" has a space in it.....


REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v MigrateProxy /t reg_dword /d 00000001 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t reg_dword /d 00000001 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyHTTP1.1 /t reg_dword /d 00000000 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t reg_multi_sz /d http://ProxyServer:80 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t reg_multi_sz /d 192.168.1.1,192.168.2.* /f
Avatar of DRRAM

ASKER

PERFECT
THANK YOU VERY MUCH DOES IT APPLY TO FIREFOX PLEASE
ahah... forgot the quotes, sorry... also, no this does not work for firefox... firefox has its own config files located in the application data directory in each users profile
Avatar of DRRAM

ASKER

please give me an example in your file how you forgot the quotes ?? for applied in firefox
i was referring to the quote johnb6767 pointed out above.

for firefox, you would need to edit the config file under a user profile and copy that config file to each workstation.
search for the config file. edit it as needed. save it and copy it to the .bat file directory.
then use the .bat file to copy it to each user directory when they login.
Avatar of DRRAM

ASKER

please I have several config file Under a user profile you can specify where is this file

and other

Please how I can create a desktop shortcut of a file. bat that is on the network through Active Directory and which is activated at the start of the session
Thx
I have answered the original question and will have to redirect you to another site posting  for the firefox settings as I do not have time to continue back and forth on this topic.

http://www.edugeek.net/forums/windows/11358-set-firefox-proxy-via-login-script.html

That should get you going.

Cheers
Avatar of DRRAM

ASKER

Please you find attached an image corresponds to my request
1 - how can I uncheck in file .bat "use automatic configuration script" (image: point 6)
2 - How can I check in file .bat "Bypass proxy server for local addresses" (image: point 8)

Thank you very much for your help
IE-Net.png
ASKER CERTIFIED SOLUTION
Avatar of DRRAM
DRRAM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DRRAM

ASKER

VERRY GOOD