Jump to content

Recommended Posts

Posted

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!

Posted (edited)

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

?

Edited by BackStabbed

tolle indicium

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

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

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

Posted

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...