Jump to content
Sign in to follow this  
jtaft

Removal of IE using @comspec

Recommended Posts

jtaft

I need a script that when run will identify the version of Internet explorer you are running and uninstall it.

I am trying to use the Run with @ComSpec and cant seem to get past the starting line here.

Here is the code I am trying.  (This is to remove IE10, I will add conditions after I am able to get the initial removal to work)

If I copy and past this in the cmd prompt it runs and removes IE10 as expected.

Any help would be greatly appreciated!

#RequireAdmin
#include <Constants.au3>

Local $IE10 = 'FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart'



Run (@ComSpec & "/c" & $IE10)

Share this post


Link to post
Share on other sites
jdelaney

It would be much easier to debug if it weren't all one command:

_FileListToArray
For loop
ConsoleWrite
RunWait

I'm not seeing your closing " wrapping your dual command.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
JohnOne

You have an odd quote in it.

Local $IE10 = 'FORFILES /P %WINDIR%servicingPackages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart'


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
jtaft

Universalist,

I understand this is a long command string. 

As far as not seeing my closing" wrapping my dual command, I guess my question there would be how would I close this command?
  

John,

As I mentioned that this exact command does run from a command prompt as presented here.
I have tried removing the odd Quote as highlighted here but it appears to be required and that is why I am wrapping this command in single quotes apposed to double quotes.

Here is were I am pulling the command from

http://blogs.msdn.com/b/askie/archive/2014/03/28/command-line-options-available-to-uninstall-internet-explorer.aspx

 

 

 

Share this post


Link to post
Share on other sites
JohnOne

Try...

Local $IE10 = 'FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c ' & '"' & 'cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart'

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
jtaft

Thanks John, But that did not worl.

I was able to get it to work by using basic codeing without @comspec  ...... HAHA

Run ("cmd")
Sleep(5000)
Send ('FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart')
Send ("{Enter}")

Share this post


Link to post
Share on other sites
jdelaney

Stick with your prior route, it's more reliable...your closing " would wrap the entire command you are running in the forfiles loop...you also needed spaces in your Run command:

Local $IE10 = 'FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*10.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"'
Run (@ComSpec & " /c " & $IE10)

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
jtaft

Thank you so much ..... That worked!  Now I see were it wasn't closed...I was one key stroke off lol

Thanks very much appreciated!!!

:thumbsup: 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×