Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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
:beginrem *** this assumes that VNC is set to manual in services so
rem *** therfore would not normally startrem *** 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 eofrem *** do nothing goto end of file VNC doesn't start
:no
echo VNC will NOT run
pause
goto eofrem *** wrong input catch all
:temp
echo Try again idiot only y or n are aloowed
pause
goto begin:eof

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

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 servicesc \\servername start winvnc
c:\myvncs\server1.vnc
sc \\servername stop winvncK2™
System/Network Engineer

![]() |
![]() |
![]() |

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