473,440 Members | 1,870 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,440 software developers and data experts.

SHELL handling a switch.....

I have the following event proceedure on a command button - which works
great, however, i would like to add the value of another field onto the
end.

e.g i have a field with the computer name in, and i would like the
program to execute with the computer name on the end of the command,
but not sure how to go about this....
something like:
stAppName = "C:\Program Files\Real\VNC4\vncviewer.exe"
computername.Value

any help is appreciated

--------------------------------------------------------------------------------------------------------------------------
Private Sub VNC_Viewer_Click()
On Error GoTo Err_VNC_Viewer_Click

Dim stAppName As String

stAppName = "C:\Program Files\RealVNC\VNC4\vncviewer.exe"
Call Shell(stAppName, 1)

Exit_VNC_Viewer_Click:
Exit Sub

Err_VNC_Viewer_Click:
MsgBox Err.Description
Resume Exit_VNC_Viewer_Click

End Sub

Dec 7 '05 #1
3 1539
either
stAppName = """" & "C:\Program Files\Real\VNC4\vncviewer.exe" & """" &
computername.Value
or
stAppName = """C:\Program Files\Real\VNC4\vncviewer.exe""" &
computername.Value

call Shell(stappname)
--
Terry Kreft

"Jason" <wi*********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I have the following event proceedure on a command button - which works
great, however, i would like to add the value of another field onto the
end.

e.g i have a field with the computer name in, and i would like the
program to execute with the computer name on the end of the command,
but not sure how to go about this....
something like:
stAppName = "C:\Program Files\Real\VNC4\vncviewer.exe"
computername.Value

any help is appreciated

--------------------------------------------------------------------------------------------------------------------------
Private Sub VNC_Viewer_Click()
On Error GoTo Err_VNC_Viewer_Click

Dim stAppName As String

stAppName = "C:\Program Files\RealVNC\VNC4\vncviewer.exe"
Call Shell(stAppName, 1)

Exit_VNC_Viewer_Click:
Exit Sub

Err_VNC_Viewer_Click:
MsgBox Err.Description
Resume Exit_VNC_Viewer_Click

End Sub

Dec 7 '05 #2
Thanks very much for that - worked a treat.

thanks for the help
Jason

Dec 7 '05 #3
On Wed, 7 Dec 2005 11:07:13 -0000, "Terry Kreft"
<te*********@mps.co.uk> wrote:

The reason Terry's code works is because you have to put double-quotes
around a path that includes funny characters or spaces.
If you had typed your original value in the Run box in Windows, it
wouldn't have worked either: Windows would have thought you wanted to
run a program called:
C:\Program
and pass it a couple of arguments like this:
Files\Real\VNC4\vncviewer.exe
and
<SomeComputerName>

-Tom.

either
stAppName = """" & "C:\Program Files\Real\VNC4\vncviewer.exe" & """" &
computername.Value
or
stAppName = """C:\Program Files\Real\VNC4\vncviewer.exe""" &
computername.Value

call Shell(stappname)


Dec 7 '05 #4

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

Similar topics

3
by: John Bowling | last post by:
I have a java (2.0) program with the following lines: String cmdArray1 = {"lp", "-d", "hp4m", "MyFile"}; System.out.println(Runtime.getRuntime().exec(cmdArray1)); It compliles properly, but...
7
by: Oliver Gräser | last post by:
Hej, I want to run batchfiles via the Shell, but accessible in the Browser via IIS. Actually, I'd like the server to start a command line ntbackup if a users selects to do so on an ASP in his...
3
by: David Eadie | last post by:
G'Day all, I cant for the God in me work out how to execute the following command line in vb.net: (watch for the word wrapping also) Sub(ByVal username As String) Shell("ECHO Y| cacls...
1
by: ckirby | last post by:
I've inherited an application for creating mail merges from an Access 2003 ADP that needs an overhaul. To generate the mail merge , the app uses a shell command: result = Shell(str, vbHide) ...
3
by: Larry Herbinaux | last post by:
I have built an asychronous TCP Server that uses the thread pool. I have two levels of exception handling in case the handling of the inner catch block throws an exception. The outer catch block...
22
by: karthikbg | last post by:
Hi, I have a Board of Coldfire communicating with a PC on the other side. The PC will be sending via TCP/IP some 5000 different command identification numbers only ( consider 1 to 5000 ) at 1...
2
by: Paul W | last post by:
Hello, My problem concerns the shell. If there's a better forum for this post, please let me know. I'm trying to create a ListView control that displays the contents of a folder with all the...
7
by: Christopher Nelson | last post by:
In Bourne shell, you can do: case ($x) in foo*) ;; *bar) ;; esac so that the first case matches any string starting with "foo", the
2
by: Michael | last post by:
I have an on-click event, where I would like the machine to release it's IP address: Shell("ipconfig /release") Why does this not work ? What is the proper way to do this ? Thanks
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.