zvision.pro Posted August 4, 2007 Posted August 4, 2007 Hello. I made a little admin bot with many controls for a voice program called Ventrilo. The program is a .exe and must be opened by using the command prompt. So, I need help at making it easier for me to open the command prompt. I'd like this script to open the cmd window, and already type cd c:\documents and settings\myname\desktop. This way I don't have to type this every time I want to use this program...Thanks in advance!
Glyph Posted August 4, 2007 Posted August 4, 2007 (edited) #include <Process.au3> $file = InputBox("Directory","What is the directory of the .exe?") _RunDOS("start "&$file) ? Edited August 4, 2007 by BackStabbed tolle indicium
zvision.pro Posted August 4, 2007 Author Posted August 4, 2007 Noo I just need it to open the command prompt and type "cd c:\documents and settings\myname\desktop". Thats it.
Glyph Posted August 4, 2007 Posted August 4, 2007 (edited) Run("cmd.exe") sleep(1000) send ('"cd c:\documents and settings\myname\desktop"') quotes are needed in DOS for spaces(documents and settings), so leave them there and type whatever you need in-between. Edited August 4, 2007 by BackStabbed tolle indicium
zvision.pro Posted August 4, 2007 Author Posted August 4, 2007 (edited) That's exactly what I need! Very simple, thank you. EDIT: When I type that in it says the filename, directory name, or volume label syntax is incorrect. I think this is because there are quotes but I dunno how to get rid of them. Help? Edited August 4, 2007 by zvision.pro
fred666777 Posted August 4, 2007 Posted August 4, 2007 (edited) try this Run("cmd") WinWaitActive("C:\Windows\system32\cmd.exe"); or the name of your cmd window Send("cd c:\documents and settings\myname\desktop{enter}"); or w/e you type in when you open the cmd window Send("exit") Edited August 4, 2007 by fred666777
ssubirias3 Posted August 4, 2007 Posted August 4, 2007 ..... I'd like this script to open the cmd window, and already type cd c:\documents and settings\myname\desktop. .......Try this, assuming the "myname" in the cd path is the current user desktop. Run(@ComSpec) Or if that doesn't work for you, maybe lookup @DesktopDir in the help file.
zvision.pro Posted August 4, 2007 Author Posted August 4, 2007 Hmm well it works and I changed it to: Run("cmd") WinWaitActive("C:\Windows\system32\cmd.exe"); or the name of your cmd window Send("cd c:\documents and settings\bobby\desktop\k33p out\cs{enter}"); or w/e you type in when you open the cmd window Send("exit") ..Because I want to go into 2 folders within my Desktop. The only problem is, when I add those two folder names to the cmd line (k33p out and cs), it only writes up to "Desktop" in the command line. Not sure why this is but any help would be appreciated!!
ResNullius Posted August 4, 2007 Posted August 4, 2007 ..Because I want to go into 2 folders within my Desktop. The only problem is, when I add those two folder names to the cmd line (k33p out and cs), it only writes up to "Desktop" in the command line. Not sure why this is but any help would be appreciated!! Try setting the working dir for the run command instead like this: $folders = "\k33p out\cs" Run(@COMSPEC,@DeskTopDir & $folders) This does away with the whole "Send" issue and the problem of worrying about quotes around folder names with spaces in them used from a command prompt
zvision.pro Posted August 4, 2007 Author Posted August 4, 2007 Works great! Thanks for the help ResNullius!
ResNullius Posted August 4, 2007 Posted August 4, 2007 Works great! Thanks for the help ResNullius!No problem
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