+ Post New Thread
Results 1 to 10 of 10
Windows Thread, XP Batch scripting Reg Delete Problem in Technical; Up in Lancs we've got to change all our proxy settings and I thought I just knock up a little ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168

    XP Batch scripting Reg Delete Problem

    Up in Lancs we've got to change all our proxy settings and I thought I just knock up a little batch file to do the job
    (I don't use AD or anything clever)

    so I did this yesterday
    Code:
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /f
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /f
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /f
    and it worked fine on a w2k3 server and win7 laptop.

    So came to next school today - and it fails on XP with
    Code:
    To many command-line parameters.
    Literal cut and past - To is spelt like that !!

    Google has got me no-where
    Anyone had this before and know the workaround?

    Simon
    PS Why is it the simple things that fail!!!!!!

  2. #2

    Join Date
    Apr 2007
    Location
    Birmingham
    Posts
    142
    Thank Post
    6
    Thanked 45 Times in 39 Posts
    Rep Power
    22
    Just tested it on xp and it seemed to work fine. Not having the quotes around the key will generate "To many command-line parameters", so might be worth double checking that.

    Alternatively can you import a .reg file with all the keys you no longer want set equal to -, e.g.
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
    "ProxyServer"=-

  3. #3

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    That code is cut and paste
    Did you try it inside a .bat file or just straight from command line
    it works for me from command line but not inside of a batch file.

    Thanks for alternative solution though

    Simon

  4. #4

    Join Date
    Apr 2007
    Location
    Birmingham
    Posts
    142
    Thank Post
    6
    Thanked 45 Times in 39 Posts
    Rep Power
    22
    Both command line and .bat file worked ok.

    No real idea why it wouldn't work, sorry

    Maybe try escaping the quotes with ^ to see if there is something strange going on with them.

  5. #5


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,899
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    This works for me on Windows 7...

    Code:
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f
    REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f

  6. #6

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    I just added the import to my wpkg packages and it works on both XP and Win7 64bit
    I could probably take the batch file bit out but I'm leaving it just in case
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!---
    
    -->
    <packages>
    
       <package
    	id="noproxy"
    	name="Set computer to No Proxy"
    	revision="1"
    	reboot="false"
    	priority="100"
    	notify="false"
    	execute="always">
    	
    	
        <install 
    			cmd='%COMSPEC% /C "%PACKAGES%\proxy\noproxy.bat"' />
    	<install 
    			cmd='%COMSPEC% /C REGEDIT.EXE  /S  "%PACKAGES%\proxy\noproxy.reg"' />
    	<upgrade 
    			cmd='%COMSPEC% /C "%PACKAGES%\proxy\noproxy.bat"' />
    	<upgrade 
    			cmd='%COMSPEC% /C REGEDIT.EXE  /S  "%PACKAGES%\proxy\noproxy.reg"' />	
        </package>
    
    </packages>
    and noproxy.reg
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
    
    "ProxyEnable"=dword:00000000
    "ProxyServer"=-
    "AutoConfigURL"=-
    Simon

  7. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,899
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    FWIW, if you look at the WPKG page for Skype, you will see that you are missing the double quotes around the registry values. i.e.

    Code:
    <install cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f' />
    <install cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f' />
    <install cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f' />

  8. #8

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    Tried that in the batch file - no diff
    I could probably run the batch files lines like yoru example - may try that tomorrow

    But its a strange error Even the error message is an error

    Simon
    Last edited by SimpleSi; 5th March 2014 at 09:50 PM.

  9. #9

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    decided at 2nd school to do it all via WPKG instead of batch script and it works fine

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!---
    
    -->
    <packages>
    
       <package
    	id="noproxy"
    	name="Set computer to No Proxy"
    	revision="1"
    	reboot="false"
    	priority="100"
    	notify="false"
    	execute="always">
    	
    	
    	<install 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f' />
    	<install 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f' />
    	<install 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f' />
    	
    	<upgrade 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "AutoConfigURL" /f' />
    	<upgrade 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f' />
    	<upgrade 
    		cmd='%COMSPEC% /C REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f' />
    
    	</package>
    </packages>
    Still very strange with that 1st error - I think it is a genuine old bug that no-ones ever sorted

    Simon

  10. #10

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,812
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    Absolutley bloomin typical

    1. This WPKG package isn't working in one of my schools (I just set it to run and didn't check as its worked flawlessly in 5 others!)


    2. The school is running fine even without it!!!!! (so thankful for small mercies)


SHARE:
+ Post New Thread

Similar Threads

  1. Script to delete profile at log off?
    By woody in forum Windows
    Replies: 74
    Last Post: 15th February 2013, 02:28 PM
  2. Replies: 9
    Last Post: 26th February 2007, 12:45 PM
  3. Replies: 3
    Last Post: 25th September 2006, 12:27 PM
  4. Replies: 7
    Last Post: 27th November 2005, 10:41 PM
  5. Script to delete printer
    By tosca925 in forum Scripts
    Replies: 2
    Last Post: 31st August 2005, 07:45 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •