473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 21746
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. Great idea which I'd like to use, but when I...
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 come out. Players actually launch the updater...
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 notepad but I also get the command shell window....
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 OUTSIDE of the IIS/asp.net environment on the...
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 context menu when you right-click over a folder (or the...
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' statement. But when I launch the batch file within...
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 copy of the access database (creating a backup)...
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 me (I have to launch directly the process). I...
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 when the command window is open I type in a bunch...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.