472,328 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

keep the DOS window open after running Call Shell command

I recently resolved an issue I had with passing a variable to a call
shell command, but now I need it to pause or leave the window open so I
can manually close it. Below is my code, and I am not sure where to
begin to keep the DOS window from closing.

Dim stAppName As String
Dim stIPAddress As String

stAppName = "C:\WINDOWS\system32\ping.exe "
stIPAddress = [IPAddress]
Call Shell(stAppName & stIPAddress, 1)

So what happens is a DOS window opens up and pings the ip address that
is listed in the form field, and once the command finishes the DOS
window closes. I would like for the DOS window to stay open.

Thanks,

Tripwire

Nov 13 '05 #1
2 21430
tr*****@gmail.com wrote:
I recently resolved an issue I had with passing a variable to a call
shell command, but now I need it to pause or leave the window open so I
can manually close it. Below is my code, and I am not sure where to
begin to keep the DOS window from closing.

Dim stAppName As String
Dim stIPAddress As String

stAppName = "C:\WINDOWS\system32\ping.exe "
stIPAddress = [IPAddress]
Call Shell(stAppName & stIPAddress, 1)

So what happens is a DOS window opens up and pings the ip address that
is listed in the form field, and once the command finishes the DOS
window closes. I would like for the DOS window to stay open.

Thanks,

Tripwire


Shell Environ$("COMSPEC") & " /k " & strAppNAme & strIPAddress,1
will keep the dos box open at the command prompt, you can carry on and
type other commands into that box until you type "exit".

Or you can
stAppName = "C:\WINDOWS\system32\ping.exe -t "

Then it will ping until you press Ctrl+C

--
[Oo=w=oO]

Nov 13 '05 #2
Used the Shell Environ$("COMSPEC") & " /k ping """ & stIPAddress, 1
and this worked great! Thanks for the help.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: jrf[no] | last post by:
Hi all, I was getting a 500 error and someone adviced me to run the php file from the command line to check what errors that would come up with....
13
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates...
2
by: Peter Gordon | last post by:
When I try to execute another program, the dos command shell window pops up with the application. For example: os.system("notepad") brings up the...
11
by: KathyB | last post by:
Hi, I have an asp.net app running on an Intranet. From one of my aspx pages I would like to run a javascript that will run the following command...
0
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's...
1
by: Rob | last post by:
I'm running a batch file using the Shell function. When I manually launch the batch file, the window remains open, since I use the 'pause'...
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a...
5
by: Stefano Tonello | last post by:
Hi all, I need to call windows' "open with" dialog from my C# windows form application. After the user selects application, control must return to...
1
by: SilverGS | last post by:
I want to automatically open a Command Window from the Startup folder in Windows XP. right now after XP starts, I click on Start run, cmd and then...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.