Jump to content
Sign in to follow this  
GAM

File path

Recommended Posts

GAM

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

Share this post


Link to post
Share on other sites
Somerset

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.


 

Spoiler

 

Share this post


Link to post
Share on other sites
Somerset

$FolderPath = """C:Program Files (x86)MyProductABC Enterprise"""

$FolderPath = '"' & "C:Program Files (x86)MyProductABC Enterprise" & '"'

 

Spoiler

 

Share this post


Link to post
Share on other sites
GAM

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

Share this post


Link to post
Share on other sites
GAM

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

Share this post


Link to post
Share on other sites
Somerset

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 by beerman

 

Spoiler

 

Share this post


Link to post
Share on other sites
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Somerset

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.


 

Spoiler

 

Share this post


Link to post
Share on other sites
GAM

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

Share this post


Link to post
Share on other sites
GAM

if the above folder is "McInternals" (without space betwee Mc Internals" then it works fine)


Neil

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  

×