zvision.pro Posted August 4, 2007 Share 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! Link to comment Share on other sites More sharing options...
Glyph Posted August 4, 2007 Share 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 Link to comment Share on other sites More sharing options...
zvision.pro Posted August 4, 2007 Author Share 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. Link to comment Share on other sites More sharing options...
Glyph Posted August 4, 2007 Share 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 Link to comment Share on other sites More sharing options...
zvision.pro Posted August 4, 2007 Author Share 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 Link to comment Share on other sites More sharing options...
zvision.pro Posted August 4, 2007 Author Share Posted August 4, 2007 Someone plz? Link to comment Share on other sites More sharing options...
fred666777 Posted August 4, 2007 Share 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 Link to comment Share on other sites More sharing options...
ssubirias3 Posted August 4, 2007 Share 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. Link to comment Share on other sites More sharing options...
zvision.pro Posted August 4, 2007 Author Share 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!! Link to comment Share on other sites More sharing options...
ResNullius Posted August 4, 2007 Share 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 Link to comment Share on other sites More sharing options...
zvision.pro Posted August 4, 2007 Author Share Posted August 4, 2007 Works great! Thanks for the help ResNullius! Link to comment Share on other sites More sharing options...
ResNullius Posted August 4, 2007 Share Posted August 4, 2007 Works great! Thanks for the help ResNullius!No problem 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