Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open cmd.exe

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
US
does anyone have a vbscript sample that would open a cmd.exe prompt from a page?

any help would be appreciated
 
Set oWSH = CreateObject("WScript.Shell")
oWSH.Run "cmd.exe"

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Ok that works in the background.
Is there a way to display the cmd.exe on the desktop?

and what if you want to run the cmd.exe from a server.
How would you do that?
And would there be any permissions issue?
 
As of Windows 2000 SP2, any process that you launch remotely will not be interactive.

You should take a look at WMI for how to launch a process on a remote server. If you need for it to be interactive, then you will want to go to and download a copy of PSEXEC.EXE.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Can I run a cmd.exe from a server? Through my web page.
It does not have to interactive. I just want it to run the code and do certian functions.
 
Yes, you can do that. You will want to pass CMD some arguments like:

Call WSHShell.Run("cmd.exe /C md \\" & strWorkstation & "\e$\Software\Workstation\Scripts")

Using /C will autoclose the window and /K keeps it open.

take a look at other CMD switches by typing CMD /? from within a command prompt.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
How would I know that the CMD.exe is running on the server?
Once I'm on a client browser.

Do you have a sample of this method?
 
You would just have to look at the running processes.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top