"VNC Server" was unexpected at this time

View: New views
3 Messages — Rating Filter:   Alert me  

"VNC Server" was unexpected at this time

by Gary Kuznitz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd like to find out if there is a service installed in XP
called VNC Server.  If there is I'd like to goto :OldInstall
This is the code I have:

setlocal
Set Service = " "
net start|find /i "VNC Server" >Service
Echo %Service%
If Service="VNC Server" &&goto :OldInstall

The Echo to display the variable isn't working.
I'm getting an Error
="VNC Server" was unexpected at this time.

If Service="VNC Server" &&goto :OldInstall

I have tried:
If %Service%="VNC Server" &&goto :OldInstall

I must be doing something wrong.  Any ideas?

Thank you,

Gary Kuznitz



RE: "VNC Server" was unexpected at this time

by Marc Peterson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You could do something like this:
 net start | find /i "vnc server"
 if not errorlevel 1 goto :OldInstall

Or, if you need the Service variable set for later use:
 set Service=
 net start | find /i "vnc server"
 if not errorlevel 1 set Service=VNC Server
 if defined Service goto :OldInstall


> -----Original Message-----
> From: batchworld@...
> [mailto:batchworld@...] On Behalf Of Gary Kuznitz
> Sent: Thursday, May 29, 2008 3:23 PM
> To: batchworld@...
> Subject: [BATCH WORLD] "VNC Server" was unexpected at this time
>
> I'd like to find out if there is a service installed in XP
> called VNC Server.  If there is I'd like to goto :OldInstall
> This is the code I have:
>
> setlocal
> Set Service = " "
> net start|find /i "VNC Server" >Service
> Echo %Service%
> If Service="VNC Server" &&goto :OldInstall
>
> The Echo to display the variable isn't working.
> I'm getting an Error
> ="VNC Server" was unexpected at this time.
>
> If Service="VNC Server" &&goto :OldInstall
>
> I have tried:
> If %Service%="VNC Server" &&goto :OldInstall
>
> I must be doing something wrong.  Any ideas?
>
> Thank you,
>
> Gary Kuznitz



Re: "VNC Server" was unexpected at this time

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 29 May 2008 16:59:24 -0400, "Marc Peterson" <marc.peterson@...>
wrote:

>You could do something like this:
> net start | find /i "vnc server"
> if not errorlevel 1 goto :OldInstall
>
>Or, if you need the Service variable set for later use:
> set Service=
> net start | find /i "vnc server"
> if not errorlevel 1 set Service=VNC Server
> if defined Service goto :OldInstall


And also:

net start|find /i "vnc server">nul && goto :OldInstall

LightInTheBox - Buy quality products at wholesale price