Sign in to follow this  
Followers 0
MCT

Need Help Creating First Semi-Complex Script

4 posts in this topic

im fairly new to autoit, my knowledge conists of "run" basically

how would i run a program silently (i can do this) & have my autoit script be able 2 accept parameters ?

the program im trying 2 run silently is "Console" which is a skin for cmd.exe it launches cmd.exe but i can get it 2 run, but it uses a switch 2 pass the directory parameter on

C:\Program Files\Console\console.exe -c "/k cd /d ""%1"""

is my command i need 2 have in autoit

Run("C:\Program Files\Console\console.exe -c "/k cd /d", "", @SW_HIDE) but how can i make it so it will open 2 the directory where i right click 2 (thats what the %1 is for)

Share this post


Link to post
Share on other sites



Welcome MCT,

Please use support forum for support. ok.

For your question for command console.

Look at Run and Runwait.

E.g.

Runwait(@Comspec & " /c setup.exe /s", "working dir", @SW_HIDE)
@Comspec is the cmd.exe interpretor. & is a concantation symbol to join commands etc. /c is for clocing cmd.exe when done. working dir can be "". @SW_HIDE hides the console window.

ok.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

im fairly new to autoit, my knowledge conists of "run" basically

<{POST_SNAPBACK}>

thats clear because you are asking for support and are posting in a forum that clearly states at the top; This is not a general support forum! :)

how would i run a program silently (i can do this) & have my autoit script be able 2 accept parameters ?

the program im trying 2 run silently is "Console" which is a skin for cmd.exe it launches cmd.exe but i can get it 2 run, but it uses a switch 2 pass the directory parameter on

C:\Program Files\Console\console.exe -c "/k cd /d ""%1"""

is my command i need 2 have in autoit

Run("C:\Program Files\Console\console.exe -c "/k cd /d", "", @SW_HIDE) but how can i make it so it will open 2 the directory where i right click 2 (thats what the %1 is for)

<{POST_SNAPBACK}>

The "Right-Click" thing you mention is not clear to me but to prompt for a directory you can use FileSelectFolder() ... just check the helpfile to get you started.

The above run command won't work.... The easiest thing is to put lines like this inside a single qouted string and use @comspec to start the program ... something like:

Run(@ComSpec & ' /c "C:\Program Files\Console\console.exe -c "/k cd /d"', "", @SW_HIDE)
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

thanks 4 the replies guys & sorry 4 posting in wrong forum, it was like 3am when i posted, i was tired :)

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