Jump to content

Another Comspec question


Recommended Posts

Run ( @Comspec & ' /c "D:\Vis.stw"', '', @SW_HIDE ) Works fine.

$Drive = StringLeft(@ScriptDir, 1)

Run ( @Comspec & ' /c $Drive & ":\Vis.stw"', '', @SW_HIDE )

This does not!

MsgBox(4096,"control", $Drive) gives me the correct drive letter "D"

What am I doing wrong?

Do I have some , or ' or " or ( or ) in the wrong place? I've tried every combination possible. Thanks

Link to comment
Share on other sites

Run ( @Comspec & ' /c "D:\Vis.stw"', '', @SW_HIDE ) Works fine.

$Drive = StringLeft(@ScriptDir, 1)

Run ( @Comspec & ' /c $Drive & ":\Vis.stw"', '', @SW_HIDE )

This does not!

MsgBox(4096,"control", $Drive) gives me the correct drive letter "D"

What am I doing wrong?

Do I have some , or ' or " or ( or ) in the wrong place? I've tried every combination possible. Thanks

Try:

Run ( @Comspec & " /c" & chr(34)& $Drive & chr(34)& ":\Vis.stw", '', @SW_HIDE )

or some thing like that...

Edited by cramaboule
Link to comment
Share on other sites

Good Lord, they work!!

Thanks so much to the both of you....

How you keep all those " and ' and &'s straight, I don't know.

You mean... How to use them ?

Well, look to the help, but basically the & is used to add your variable to a string

$var = 123

$myvariable = "text" & $var

$myvariable will be :

text123

the " well,... to delimit your text, string,...

the ' I never used it...

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...