{"id":37,"date":"2006-07-17T10:38:48","date_gmt":"2006-07-16T22:38:48","guid":{"rendered":"http:\/\/craig.dubculture.co.nz\/blog\/2006\/07\/17\/windows-tips-starting-winvnc-automatically-if-not-running\/"},"modified":"2007-04-14T14:34:53","modified_gmt":"2007-04-14T02:34:53","slug":"windows-tips-starting-winvnc-automatically-if-not-running","status":"publish","type":"post","link":"http:\/\/craig.dubculture.co.nz\/blog\/2006\/07\/17\/windows-tips-starting-winvnc-automatically-if-not-running\/","title":{"rendered":"Windows tips: Starting WinVNC automatically if not running"},"content":{"rendered":"<p>A long time ago I built an installer for WinVNC so that <a href=\"http:\/\/www.itpartners.co.nz\/\">IT Partners<\/a>' clients can connect back to us and we can fix their problems remotely.<\/p>\n<p>A problem I have always had with it was that you have to launch WinVNC seperately from a connection shortcut; if you tried to run it every time, it would say \"Another instance of WinVNC is already running\", and if you go to connect when there isn't a running WinVNC, you get \"No existing instance of WinVNC could be contacted\".  Therefore, users need to perform two distinct steps - a \"launch\", which does -kill -run, and a \"start session\", which does a -connect.<\/p>\n<p>Here is a nice batch file to get around it, using <a href=\"http:\/\/www.sysinternals.com\/Utilities\/PsList.html\">SysInternals' PSList utility<\/a>. If you know your users are on Windows XP or greater, you could use the built in <a href=\"http:\/\/www.ss64.com\/nt\/tasklist.html\">tasklist<\/a> command instead.<\/p>\n<div class='code_parent'>\n<div class='code_title'>Code:<\/div>\n<div class='code_child'><code><\/p>\n<div class='pre_container'>\n<pre>@echo off\r\npslist winvnc &gt; nul\r\nif %ERRORLEVEL% EQU 0 goto connect\r\nstart winvnc -run<\/pre>\n<\/div>\n<p><\/code><\/div>\n<\/div>\n<div class='code_parent'>\n<div class='code_title'>Code:<\/div>\n<div class='code_child'><code><\/p>\n<div class='pre_container'>\n<pre>:connect\r\nif [%1] NEQ [] start winvnc %1 %2 %3 %4 %5<\/pre>\n<\/div>\n<p><\/code><\/div>\n<\/div>\n<div class='code_parent'>\n<div class='code_title'>Code:<\/div>\n<div class='code_child'><code><\/p>\n<div class='pre_container'>\n<pre>:end<\/pre>\n<\/div>\n<p><\/code><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A long time ago I built an installer for WinVNC so that IT Partners' clients can connect back to us and we can fix their problems remotely. A problem I have always had with it was that you have to launch WinVNC seperately from a connection shortcut; if you tried to run it every time, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[66,68],"tags":[3,27,4],"_links":{"self":[{"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/craig.dubculture.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}