Computing.Net > Forums > Programming > Batch file for VNC

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file for VNC

Reply to Message Icon

Name: markbarry1977
Date: August 25, 2008 at 05:54:47 Pacific
OS: XP SP2
CPU/Ram: celeron /2gb
Product: samsung p28
Comment:

I have just started playing with batch files and have no experiance so be gentle with me. I have written the following batch file and my question is this can i force the batch file to take a default answer after a period of time (somewhat like the choice /t/d command availible in non NT based systems.) i have heard of people copying the choice command over from 98 machine but i dont want to do that. All help greatfully received.

@echo off
cls
:begin

rem *** this assumes that VNC is set to manual in services so
rem *** therfore would not normally start

rem *** gets inut from user
set /p answer=Do you want the VNC server to run? (Y/N)

rem *** decides on action to carry out
if /i "%answer%"=="y" goto yes
if /i "%answer%"=="n" goto no
goto temp


rem *** start VNC Server application
:yes
echo VNC will run
rem start **** ultravnc.exe file location
pause
goto eof

rem *** do nothing goto end of file VNC doesn't start
:no
echo VNC will NOT run
pause
goto eof

rem *** wrong input catch all
:temp
echo Try again idiot only y or n are aloowed
pause
goto begin

:eof



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 25, 2008 at 10:01:09 Pacific
Reply:

I use CHOICE from DOS 6.2 LOL.

By the way, you don't need to write in :eof because it's built in. BUT, very oddly, you need the colon, like this

goto :eof


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: alwaysk2
Date: August 26, 2008 at 19:41:40 Pacific
Reply:

use below stated command to manually start or stop vnc service to specified server or pc.

sc \\servername start winvnc


If you have saved a CONNECTION OF VNC and having its file .VNC than you can directly point it out like and after use of vnc you can close the vnc service

sc \\servername start winvnc
c:\myvncs\server1.vnc
sc \\servername stop winvnc

K2™
System/Network Engineer


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file for VNC

Batch file for Outlook www.computing.net/answers/programming/batch-file-for-outlook/15439.html

Batch file input for logevent.exe www.computing.net/answers/programming/batch-file-input-for-logeventexe/15380.html

Batch file FOR LOOP www.computing.net/answers/programming/batch-file-for-loop/11504.html