GAM Posted March 18, 2013 Share Posted March 18, 2013 Hi, Am trying to pass the folder path in the RUN function but its not working, its giving me no result. The code snippet is... ---------------------------------------------------------------------------- $FolderPath = """C:\Program Files (x86)\MyProduct\ABC Enterprise""" Run(@ComSpec & " /c " & """" & @ScriptDir & "\" & "sigcheck.exe""" & " -a -s -q -v " & "" & $FolderPath & "" & " >> " & @ScriptDir & "\Precheck\" & "sigcheck.txt", "", @SW_HIDE) ---------------------------------------------------------------------------- If I give the path directly in the RUN function then it works...like below... Run(@ComSpec & " /c " & """" & @ScriptDir & "\" & "sigcheck.exe""" & " -a -s -q -v " & "C:\Test" & " >> " & @ScriptDir & "\Precheck\" & "sigcheck.txt", "", @SW_HIDE) Can someone help please? Neil Link to comment Share on other sites More sharing options...
Somerset Posted March 18, 2013 Share Posted March 18, 2013 Wow a quote nightmare. You should quote quotes like this '"' , It makes it easier for you to tell the difference. (Yes it is ' " ' not this " " " ...) don't include the spacing that is to show you can use single quotes not just the double quotes. Link to comment Share on other sites More sharing options...
Somerset Posted March 18, 2013 Share Posted March 18, 2013 $FolderPath = """C:Program Files (x86)MyProductABC Enterprise"""$FolderPath = '"' & "C:Program Files (x86)MyProductABC Enterprise" & '"' Link to comment Share on other sites More sharing options...
GAM Posted March 18, 2013 Author Share Posted March 18, 2013 Thanks for the reply... I have tried as you have suggested but it still didnt work..This is what I have tried... Run(@ComSpec & " /c " & '"' & @ScriptDir & "" & "sigcheck.exe" & '"' & " -a -s -q -v " & '"' & $FolderPath & '"' & " >> " & '"' & @ScriptDir & "Precheck" & "sigcheck.txt" & '"', "", @SW_HIDE) Neil Link to comment Share on other sites More sharing options...
GAM Posted March 18, 2013 Author Share Posted March 18, 2013 I have tried this...didnt work... $FolderPath = '"' & "C:Program Files (x86)MyProductABC Enterprise" & '"' Run(@ComSpec & " /c " & '"' & @ScriptDir & "" & "sigcheck.exe" & '"' & " -a -s -q -v " & $FolderPath & " >> " & '"' & @ScriptDir & "Precheck" & "sigcheck.txt" & '"', "", @SW_HIDE) Neil Link to comment Share on other sites More sharing options...
Somerset Posted March 18, 2013 Share Posted March 18, 2013 (edited) write out what you want to run as if you had to type it into command prompt. i think you are quoting to much stuff. It is getting confusing. Edited March 18, 2013 by beerman Link to comment Share on other sites More sharing options...
water Posted March 18, 2013 Share Posted March 18, 2013 The string doesn't look bad. Replace /c with /k so the DOS window stays open and you can see error messages that might appear. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
Somerset Posted March 18, 2013 Share Posted March 18, 2013 I have tried this...didnt work...$FolderPath = '"' & "C:Program Files (x86)MyProductABC Enterprise" & '"'Run(@ComSpec & " /c " & '"' & @ScriptDir & "" & "sigcheck.exe" & '"' & " -a -s -q -v " & $FolderPath & " >> " & '"' & @ScriptDir & "Precheck" & "sigcheck.txt" & '"', "", @SW_HIDE)Run(@ComSpec & " /c " & @ScriptDir & "sigcheck.exe -a -s -q -v " & $FolderPath & " >> " & @ScriptDir & "Prechecksigcheck.txt", "", @SW_HIDE)Okay, i hope this works if i read it correctly. Link to comment Share on other sites More sharing options...
GAM Posted March 18, 2013 Author Share Posted March 18, 2013 Sorry for the confusion, here is what I'm trying to get the output... 1) I have a tool called "Sigcheck.exe" (this is under the same location "Mc Internals" on desktop where am running my autoit script) 2) The path that I want to check for the target location is "C:Program Files (x86)MyProductABC Enterprise". 3) The command that I want to run is ... [cmd prompt]"sigcheck.exe" -a -s -q -v "C:Program Files (x86)My ProductABCEnterprise" >> "C:UsersAshuDesktopMc InternalsPrecheck"sigcheck.txt" Neil Link to comment Share on other sites More sharing options...
GAM Posted March 18, 2013 Author Share Posted March 18, 2013 if the above folder is "McInternals" (without space betwee Mc Internals" then it works fine) Neil 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