Jump to content

Lost with CMD Prompt!


Recommended Posts

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

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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!!

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

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