MCT Posted November 29, 2004 Share Posted November 29, 2004 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 More sharing options...
ZeDMIN Posted November 29, 2004 Share Posted November 29, 2004 try this: Run('C:\Program Files\Console\console.exe -c "/k cd /d ""' & $CmdLine[1] & '"""', "", @SW_HIDE) Greetings, ZeD Link to comment Share on other sites More sharing options...
MCT Posted November 29, 2004 Author Share Posted November 29, 2004 perfect thanks very much Link to comment Share on other sites More sharing options...
Nova Posted November 29, 2004 Share Posted November 29, 2004 (edited) 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 November 29, 2004 by nova Link to comment Share on other sites More sharing options...
Developers Jos Posted November 29, 2004 Developers Share Posted November 29, 2004 (edited) 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 November 29, 2004 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 More sharing options...
Nova Posted November 29, 2004 Share Posted November 29, 2004 (edited) 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 November 29, 2004 by nova Link to comment Share on other sites More sharing options...
SlimShady Posted November 29, 2004 Share Posted November 29, 2004 (edited) @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 November 29, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Nova Posted November 29, 2004 Share Posted November 29, 2004 Got it workin now cheers SlimShady and JdeB Link to comment Share on other sites More sharing options...
Developers Jos Posted November 29, 2004 Developers Share Posted November 29, 2004 @JdeBThe 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now