Sign in to follow this  
Followers 0
Noralain

how to run this CMD commands in autoit

4 posts in this topic

Dear support how to run this code on autoit

 

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

 

the issue I have it with this CMD command is that it does have " in middle, which it's break the code on auto it.

I'm pretty sure there is something I have to do like on HTML we can replace it with just single ' 

how I can make it on autoit ?

 

my code is the following

 
   Local $iPID = RunAsWait($sUserName, "noralain", $sPassword, 0, @ComSpec & " /C " & "FORFILES /P %WINDIR%servicingPackages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart", "",@SW_HIDE)
 
 
 
 

Share this post


Link to post
Share on other sites



escape the double quote by doubling it. That or use single (not double) quotes to enclose your string.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What he said:

Local $iPID = RunAsWait($sUserName, "noralain", $sPassword, 0, @ComSpec & '"' /C '"' & '"'FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c '"'cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart'"', "",@SW_HIDE)
Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

Or you could ditch command line altogether and do it all in autoit...

#include <Array.au3>
#include <File.au3>

Local $aPackages = _FileListToArray(@WindowsDir & "\servicing\Packages", "Microsoft-Windows-InternetExplorer-*11*.mum")

    For $i = 1 To $aPackages[0]
        $packageName = StringTrimRight($aPackages[$i], 4)
        MsgBox(0, "Uninstall Updates", "Uninstalling " & $packageName, 5)
        ShellExecute("pkgmgr.exe", "/up " & $packageName & " /quiet /norestart")
    Next

√-1 2^3 ∑ π, and it was delicious!

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  
Followers 0