Jump to content
Sign in to follow this  
johnmcloud

Macro in @ComSpec Command?

Recommended Posts

johnmcloud

Hi community, i'm new here.

My name is John :)

I'd like to insert Macro in @ComSpec command.

I have a .bat file with this script example:

C:\Folder01\Start.exe -10 C:Folder02\End.exe

The .bat working.

I want to make a .exe with @WORKINGDIR and @ComSpec Command because i can't to write the exact directory for deploy to another my PC with a different folder position.

I try:

$var1 = @WorkingDir & '\Folder01\Start.exe' 
$var2 = '-10 ' 
$var3 = @WorkingDir & '\Folder02\End.exe'
RunWait( @ComSpec & " /c " & $var1&$var2&$var3 )

But not work. I have use Macro in other ways, but in this case i don't now how to do. I'm a beginner, sorry ;)

Thanks

Share this post


Link to post
Share on other sites
LurchMan

I think what you are looking for is @ScriptDir. It contains the directory that the script resides in.


Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
johnmcloud

browser problem.

Sorry

Edited by johnmcloud

Share this post


Link to post
Share on other sites
johnmcloud

The script is correct?

I have only sostitute the @workingdir with @scriptdir?

Thanks

Share this post


Link to post
Share on other sites
LurchMan

The script is correct?

I have only sostitute the @workingdir with @scriptdir?

Thanks

It looks good from what I see, except you might want to do "$var1 & " " & $var2 & " " & $var3" so the variables have a space in between them for the command to work.

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites
johnmcloud

i'm test it...

Edited by johnmcloud

Share this post


Link to post
Share on other sites
johnmcloud

another browser error.

Please sorry me.

Edited by johnmcloud

Share this post


Link to post
Share on other sites
johnmcloud

i'm test it...

And don't work :)

How can i do?

P.s the script is in the main directory of the folder

Share this post


Link to post
Share on other sites
KaFu

There were definitely some spaces missing, also check the console for output.

$var1 = @WorkingDir & '\Folder01\Start.exe'
$var2 = '-10 '
$var3 = @WorkingDir & '\Folder02\End.exe'
$sCmd = @ComSpec & " /c " & $var1 & " " & $var2 & " " & $var3
ConsoleWrite($sCmd & @CRLF)
RunWait($sCmd)

Share this post


Link to post
Share on other sites
johnmcloud

i have resolved

I use msgbox for see "" and space.

When everyting was ok I don't use @comspec but simply runwait($cmd)

$cmd is equal to var1 / var2 / var3

Thanks for support

John

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.