Jump to content

Need Help Creating First Semi-Complex Script


MCT
 Share

Recommended Posts

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)

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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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