Jump to content

File path


GAM
 Share

Recommended Posts

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

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

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

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

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 - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...