Jump to content
christina_applegate

shellexecute path name variable

Recommended Posts

hey guys,

i'm not much of a coder so please bear with me if this seems a little low brow

what i am having a problem with is introducing a variable into a shellexecute command that works;

ShellExecute("C:\Users\frank\Documents\SFiles\C\New York Mets.sfcht")

above works fine, file opens and then i am able to manipulate with autoit

but when i attempt to get the 'New York Mets' from the clipboard

$Name1=ClipGet()
ShellExecute("C:\Users\frank\Documents\SFiles\C\" & $Name1 & ".sfcht")

 i get an error message

Windows cannot find 'C:\Users\frank\Documents\SFiles\C\New York Mets.sfcht'. Make sure........

i have been through the forums and the help files but no luck so far

any help most appreciated

 

christinaA

 

Share this post


Link to post
Share on other sites

Doubt the text is exactly the same on the clipboard. Have you checked there are no extra spaces or a Tab char maybe?
Just write the text you retrieve from the clipboard to a file for checking.

Jos

Share this post


Link to post
Share on other sites

Check if the string is correct. What does this code returns ?

$Name1=ClipGet()
MsgBox(0, "", FileExists("C:\Users\frank\Documents\SFiles\C\" & $Name1 & ".sfcht") )

 

Share this post


Link to post
Share on other sites

hi philkryder,

i tried your code but had to add $ in front of Name1 as in:

msgbox(0,"",">" & $Name1 & "<")

and the return was:

>New York Mets

<

christinaA

This seems to indicate that there is a CR / LF or CRLF added to the end of the text.
Try stripping those.

Jos

Edited by Jos

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

×
×
  • Create New...