Sign in to follow this  
Followers 0
fmen

Another Comspec question

7 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

The problem was that the second time, you had the string

' /c $Drive & ":\Vis.stw"'oÝ÷ Ù.¦ël¢g¢+µ©í¶§È§²'^¶¬¶¸§ò¢çhmÁ©í¶¬x(kߨ¹Ê.Û¬zØ^¢¸ v¥²Úâ(®·¶±«­¢+ØÌäì½ÌäìµÀìÀÌØíÉ¥ÙµÀìÌäìÅÕ½ÐìèÀäÈíY¥Ì¹ÍÑÜÅÕ½ÐìÌä

Share this post


Link to post
Share on other sites

I'm sorry

' /c "' & $Drive & ':\Vis.stw"'

is what you want.

I would have edited the post, but I got a weird error.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

When you work with strings enough, you learn your apostrophes. It's just experience.

Share this post


Link to post
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...

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  
Followers 0