DigDeep Posted November 12, 2015 Share Posted November 12, 2015 Hi,When I run the McAfee policies via command prompt it runs correctly, but if I use them as @Comspec, it does nothing.Command Prompt:cd C:\Program Files (x86)\McAfee\Common Framework> cmdagent.exe /pAutoIT:RunWait(@ComSpec & ' /c "C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe /p"', "", @SW_Hide) Link to comment Share on other sites More sharing options...
Valuater Posted November 12, 2015 Share Posted November 12, 2015 MAybe try the "K" to see what is going on... RunWait(@ComSpec & ' /k Link to comment Share on other sites More sharing options...
Developers Jos Posted November 12, 2015 Developers Share Posted November 12, 2015 (edited) try this to ensure the workdir is correct and to bring the /p parameter outside of the double quotes:RunWait(@ComSpec & ' /c "C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" /p', "C:\Program Files (x86)\McAfee\Common Framework", @SW_Hide)Jos Edited November 12, 2015 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Valuater Posted November 12, 2015 Share Posted November 12, 2015 (edited) AND because of the spaces try FileGetShortName()8) EDIT: Too slow!! Edited November 12, 2015 by Valuater Link to comment Share on other sites More sharing options...
DigDeep Posted November 12, 2015 Author Share Posted November 12, 2015 @ Jos It worked. Thanks. Link to comment Share on other sites More sharing options...
DigDeep Posted November 18, 2015 Author Share Posted November 18, 2015 Hi,Just wanted to check how can I write the same command using Variables?RunWait(@ComSpec & ' /c "C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" /p', "C:\Program Files (x86)\McAfee\Common Framework", @SW_Hide)I tried as below but it does not work...Global $McAfeeFramework = "C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe /p" RunWait(@ComSpec & ' /c ' & $McAfeeFramework, "C:\Program Files (x86)\McAfee\Common Framework", @SW_Hide) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2015 Moderators Share Posted November 18, 2015 DigDeep,Use external single quotes to make the internal double quotes part of the string:Global $McAfeeFramework = '"C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe /p"'M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Trong Posted November 18, 2015 Share Posted November 18, 2015 (edited) try this to ensure the workdir is correct and to bring the /p parameter outside of the double quotes Global $McAfeeFramework = '"C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" /p' RunWait(@ComSpec & ' /c ' & $McAfeeFramework, "C:\Program Files (x86)\McAfee\Common Framework", @SW_Hide) If your script frequently reuse the command line you should: Global $McAfeeFrameworkEXE = "C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" Global $McAfeeFrameworkDIR = "C:\Program Files (x86)\McAfee\Common Framework" RunWait(@ComSpec & ' /c "' & $McAfeeFramework &'" /p', $McAfeeFrameworkDIR, @SW_Hide) ;Or Global $McAfeeFrameworkEXE = '"C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" ' Global $McAfeeFrameworkDIR = "C:\Program Files (x86)\McAfee\Common Framework" RunWait(@ComSpec & ' /c ' & $McAfeeFramework &'/p', $McAfeeFrameworkDIR, @SW_Hide) Edited November 18, 2015 by Trong Add code! Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2015 Moderators Share Posted November 18, 2015 Trong,Thanks for the correction - I really should have read the thread from the start.M23 Trong 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DigDeep Posted November 18, 2015 Author Share Posted November 18, 2015 I also tried as per below and it worked good.Global $McAfeeFramework = '"C:\Program Files (x86)\McAfee\Common Framework\cmdagent.exe" /p' RunWait(@ComSpec & ' /c "' & $McAfeeFramework & '" /p', "", @SW_HIDE)Thanks... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now