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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable in a command line

Status
Not open for further replies.

RGoldthorpe

Technical User
Aug 10, 2001
83
0
0
GB
PLease help having not done an awful lot of programming before in VB

Could somebody help me please

I have the following code

Private Sub Viewer_Button_Click()
On Error GoTo Err_Viewer_Button_Click

Dim stAppName As String
Dim LSMTAG As String
LSMTAG = Form_Computers.Combo6.Value
stAppName = "C:\Program Files\ORL\VNC\vncviewer.exe"
Call Shell(stAppName, 1)

Exit_Viewer_Button_Click:
Exit Sub

What I would like to know is how can I use LSMTAG as a switch at the end of the vncveiwer line so that it tell the command line which pc to log on to

E.G "C:\Program Files\ORL\VNC\vncviewer.exe" /lsmtag

where LSMTAG is a computer name

Please explain really simply coz I not very good
 
Based on what you've said, this should work:

stAppName = "C:\Program Files\ORL\VNC\vncviewer.exe /" & lsmtag

BUT I haven't tried it, and am no expert in shelling other apps. Apologies if it doesn't work.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top