Sign in to follow this  
Followers 0
zvision.pro

Lost with CMD Prompt!

12 posts in this topic

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <Process.au3>
$file = InputBox("Directory","What is the directory of the .exe?")
_RunDOS("start "&$file)

?

Edited by BackStabbed

tolle indicium

Share this post


Link to post
Share on other sites

Noo I just need it to open the command prompt and type "cd c:\documents and settings\myname\desktop". Thats it.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by BackStabbed

tolle indicium

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by zvision.pro

Share this post


Link to post
Share on other sites

Someone plz?

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by fred666777

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Works great! Thanks for the help ResNullius!

Share this post


Link to post
Share on other sites

Works great! Thanks for the help ResNullius!

No problem :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0