Advertisement

05.13.2008 at 06:28PM PDT, ID: 23399999
[x]
Attachment Details

Running and connecting server automatically

Asked by mcordi in Windows Batch Scripting, C++ Programming Language, Microsoft Applications

Tags: UltraVNC, UltraVNC, 1.1.0.2, Weird problem - batch

hello experts

I am trying to set up a VNC server to auto-run and auto-connect to an IP via a batch script

@echo off
%SYSTEMROOT%\vncserver.exe -run
%SYSTEMROOT%\vncserver.exe -connect MyIP::5500

I'm having a very strange problem. I have the listener set up to 5500 and it works fine

the problem is, once I run the batch script, all that happens is it runs vncserver.exe, it doesn't run -connect MyIP::5500

Upon executing the batch script a SECOND TIME, VNC reports back that there is already one instance running and you cannot run another. After you close the message, the listener connects to it

So for some reason, it needs VNC to be already running in order to work, despite the
"%SYSTEMROOT%\vncserver.exe -run" command

Also I tried to do it in C++ still with no luck:

#include "windows.h"

void install();
int main(int argc, char* argv[])
{
system("%SYSTEMROOT%\\svchost.exe -run");
Sleep(2000);
install();
      return 0;
}

void install()
{
      system("%SYSTEMROOT%\\svchost.exe -connect 67.83.58.177::5500");
}


What am I doing wrong?!Start Free Trial
 
Loading Advertisement...
 
[+][-]05.13.2008 at 06:59PM PDT, ID: 21560687

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows Batch Scripting, C++ Programming Language, Microsoft Applications
Tags: UltraVNC, UltraVNC, 1.1.0.2, Weird problem - batch
Sign Up Now!
Solution Provided By: JesterToo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.13.2008 at 10:03PM PDT, ID: 21561384

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 06:20AM PDT, ID: 21563814

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628