Link to home
Start Free TrialLog in
Avatar of Simples
Simples

asked on

Simple VB script needed

Hi all,

I would like someone to write a VB script for me if they would be so kind.

I need to run RealVNC in reverse mode.

What I need is a dialog box that can run from a shortcut from the Windows 7 desktop. the dialog box should accept the computer name or IP address and put the data typed in by the user into the address bit of this command : "C:\Program Files\RealVNC\VNC4\winvnc4.exe" -service -connect address

Additionally I would also like the above RealVNC command to run as administrator as no user has admin rights to their PC but this is required fro the command to run successfully.

Many thanks

S.
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Simples, did the code in the last post here help you out https://www.experts-exchange.com/questions/28212410/VNC-script-for-users.html or do you need something different.   If the bottom answer is what worked, we can get that answer changed.
Avatar of Simples
Simples

ASKER

No sorry it's a very clunky looking DOS box ( showing my age here). I'd like a decent looking dialog box ! Thanks
SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Simples

ASKER

Thanks for this info. I am getting an error when running the script however. (I copied and pasted it so no typo's). the correct version of VNC is installed at the correct location and the exe file is there. I can run

I enter the ip address and then I have an error window appearing from Windows Script Host telling me that at  at line5, char 1 there is a Type mismatch:'[string:C:\Program Files\Rea"]. and the code is 800A000D.The source is Microsoft VBScript runtime error. I am logged into the PC as the local admin.

The command C:\Program Files\RealVNC\VNC4\winvnc4.exe -service -connect " & address, 1, false  does run perfectly when in a command prompt window but not from the script
it could be escape character related ie the backslash so you could try

WshShell.Run "C:\\Program Files\\RealVNC\\VNC4\\winvnc4.exe -service -connect " & address, 1, false

or even the space in Program Files

WshShell.Run "C:\""Program Files""\RealVNC\VNC4\winvnc4.exe -service -connect " & address, 1, false

or a combination of the both :)

WshShell.Run "C:\\""Program Files""\\RealVNC\\VNC4\\winvnc4.exe -service -connect " & address, 1, false
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial