Jump to content

Run Program Hidden & Passing Directory Parameters?


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)

thanks guys/girls :)

Link to comment
Share on other sites

Ive tryed editing the above code in order to do something very simular but I cant get it to work !

I want to run a program called netcat with the folowing parameters !

Nc -l -p 4444 -t -e cmd.exe

The directory for netcat is C:/Software/Netcat.exe

Ive tryed tons of varations and cannot get one to work as of yet !

Little help ?

Edited by nova
Link to comment
Share on other sites

  • Developers

Ive tryed tons of varations and cannot get one to work as of yet !

Little help ?

<{POST_SNAPBACK}>

run('C:/Software/Netcat.exe Nc -l -p 4444 -t -e cmd.exe','C:/Software' )

EDIT: updated script

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

JdeB when I ran ur code I got an error saying that the system cannot find the path specified!

Heres what im curently using to run netcat with the parameters I need but its very messy !

Opt("WinTitleMatchMode",4)
Run('C:/Software/Netcat.exe', "",@SW_HIDE)
WinWait("classname=ConsoleWindowClass")
$hWnd = WinGetHandle("classname=ConsoleWindowClass")
ControlSend($hWnd,"","","nc -l -p 4444 -t -e cmd.exe{ENTER}")

Any ideas how I can use the run command plus parameters instead of the above ?

Edited by nova
Link to comment
Share on other sites

@JdeB

The 2nd parameter is meant for the working directory, remember?

This should work 100%.

If it doesn't work, I bet you know how to fix it.

Run('C:\Software\Netcat.exe -l -p 4444 -t -e ' & @ComSpec, "", @SW_HIDE)
Edited by SlimShady
Link to comment
Share on other sites

  • Developers

@JdeB

The 2nd parameter is meant for the working directory, remember?

This should work 100%.

If it doesn't work, I bet you know how to fix it.

Run('C:\Software\Netcat.exe -l -p 4444 -t -e ' & @ComSpec, "", @SW_HIDE)

<{POST_SNAPBACK}>

yeap... done this too often and wasn't focused enough... :)

guess i belong to the category "Humans" not "Uber Scripters" :)

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