Sign in to follow this  
Followers 0
archrival

VNC Plugin for Explorer

19 posts in this topic

#1 ·  Posted (edited)

My roommate asked me if there was a way to start/stop/connect to a network machine via VNC through Network Neighborhood. I didn't know, couldn't find anything relevant, so I decided to write my own. I decided to make this as an installer as well. It will write to HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall, has a versioning system, allows upgrades, selection of installation directory, VNC type etc. This probably needs a README, but I haven't made one yet. I hadn't planned on releasing this, but I find it rather useful. I also have plans to add an option to display all services running on remote machine, firstly I have plans for remote desktop. This currently needs psservice.exe from sysinternals.com and a vncviewer (by default I use ultravnc). There is also a configuration file (vncview.ini in the installation directory), that allows you to set options. I have it only work as an executable and not a script as well. I think if you just take a look at my sloppy code, you can figure it out. What I'd really like is some feedback, this is my first real attempt at organized code. Find problems with my code, ineffeciencies, mistakes, etc. To install it, just double click on it after compiling. It will not attempt to install when run from the directory it was installed to. I've also included the ultravnc icon to make it pretty. :) I'll make sure to post each revision as I make it.

http://www.autoitscript.com/fileman/users/public/archrival/vncview.au3

http://www.autoitscript.com/fileman/users/public/archrival/vnc.ico

If you have any questions about my script, please ask.

Edit:

Current version: 1.42.9.7

Changes to 1.42.9.4:

Display installation defaults when electing to no change defaults.

Code cleanup.

Changes to 1.42.9.7:

Remove unneeded () from EndFunc

Improved upgrade process, will now query file version and will not blindly copy over the same file version. I know this will cause problems with different vncviewer types, but I assume if you are upgrading you will be copying the same vncviewer. Will probably change to only copy vncview.exe in the future.

Added option to specify machine name in INI file, the only 2 options available are in this example:

[Location]

psservice=C:\VNCView\psservice.exe

vncviewer=C:\VNCView\vncviewer.exe

scale=100

port=5900

view=no

full=no

toolbar=no

auto=no

implementation=ultra

[archrival]

view=yes

port=4321

Edited by archrival

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

All changes are now in VNC Plugin Ver. 2

Edited by archrival

Share this post


Link to post
Share on other sites

I'm sorry, I dont quite understand what your application does. I just got done automating what I want on VNC. I need remote machines to email me ip/port/password changes. I have created a script that will do just that.

I may be able to use it with your script to make it more handy, though I am not sure as I am not certain as to what your script does.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Let me clarify a little:

We worked at a company with 1000+ NT & XP Pro. machines in the domain. We used VNC to connect remotely to setup email, remove spyware and basically for whatever else we could do without leaving our desk. We had a 3rd party program called Hyena which is a fairly robust domain management tool that had some VNC connectivity built in. I wanted to make a freeware program that mainly offered the VNC connectivity part. So what I came up with allows you to right click on a machine name in your domain or workgroup in Network Neighborhood/View Workgroup Computers and it gives you these 4 options:

---> Start VNC Service and Connect

---> Check Status Of VNC Service

---> Start VNC Service

---> Stop VNC Service

Those should all be self explanatory. It wil tell you whether or not the service is started, disabled, stopped, does not exist or if access is denied while retrieving the service list. It's a relatively simple concept that I've probably made way too complicated. It's configured through an INI file. You can basically change the port to connect to, whether you want it to be fullscreen and the flavor of the VNC viewer you are using (ultra, real or tight). That was the end of my initial program. I let it sit around for a while and then decided I wanted to see if I could make the file self install. That was a days worth of work, but it works and it's alot easier to distribute now since it will add the proper registry entries, move the files to the proper place, etc. Like I said, I do have plans to extend the functionality, like added support in the INI file for configuring each machine differently (mainly a different port). I also have plans for Remote Desktop and maybe down the road implementing the starting and stopping of any service. I hope that clears it up.

Share this post


Link to post
Share on other sites

It does... that is excellent. I have seen your code and am still looking it over. There are alot of lines. It looks really good from what I have seen thus far. I like it.

Good work,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Yeah, there's a lot lines... :"> I like to be precise, I was trying to account for any and every situation. Parts of the code I'm sure could be streamlined a lot better. That's part of the reason why I posted it.

Share this post


Link to post
Share on other sites

Very nice .. Thanks, this will come in handy!

:):);)

Share this post


Link to post
Share on other sites

A little dated, but along the same lines, is Gencontrol. It takes TightVNC and makes it act like DameWare Remote Control.

Gencontrol Homepage

Share this post


Link to post
Share on other sites

A little dated, but along the same lines, is Gencontrol. It takes TightVNC and makes it act like DameWare Remote Control.

Gencontrol Homepage

<{POST_SNAPBACK}>

Looking at that site gave me the idea of searching for all machines with the VNC service running. It should be rather easy to do. This has become one of those "Ok, I'll add this and this just to see if I can do it." It's handy for me though, so that's all that matters. :)

Share this post


Link to post
Share on other sites

You may want to change some lines like this:

Func CheckFileExist()
   If FileExists($psservice) Then
      Sleep(0)
   Else ...
   EndIf

To:

Func CheckFileExist()
   If Not FileExists($psservice) Then
      ...
   EndIf

By using a NOT there is no need to do a Sleep(0) just to fill the first If statement.. I hope it is clear..

Pretty good job though :idiot:

Share this post


Link to post
Share on other sites

You may want to change some lines like this:

Func CheckFileExist()
   If FileExists($psservice) Then
      Sleep(0)
   Else ...
   EndIf

To:

Func CheckFileExist()
   If Not FileExists($psservice) Then
      ...
   EndIf

By using a NOT there is no need to do a Sleep(0) just to fill the first If statement.. I hope it is clear..

Pretty good job though :idiot:

<{POST_SNAPBACK}>

Yeah, I wrote those before I realized I could use NOT in those statements. I also don't like the length of my variable names, I did it for ease of use, and even then I'm confused by some of them. Thanks for the input! Like I said, it's my first real structured script. I'd like to learn C/C++ and I figure this is a better stepping stone (than just forcing myself to learn it) for me because it allows me to learn the most efficient way of accomplishing a task. I've done mostly batch files, I needed a scripting language I could compile into an .exe file, mainly because virus checkers like to disable vb scripts. AutoIt has been perfect for me. It allows me to do pretty much everything I've needed! I love it.

Share this post


Link to post
Share on other sites

I've done mostly batch files, I needed a scripting language I could compile into an .exe file, mainly because virus checkers like to disable vb scripts. AutoIt has been perfect for me. It allows me to do pretty much everything I've needed! I love it.

<{POST_SNAPBACK}>

Same here.. :idiot:

Share this post


Link to post
Share on other sites

Updated yet again to 1.43.0.1:

Changes since 1.42.9.7:

Rewrote status functions into one function, Status()

Hopefully improved accuracy of status checking.

Probably need to add check for user rights, obviously if you don't have access rights to the machine you are checking you can't start or stop the service and you also can't check to see if it's disabled.

Fixed If FileExists issues thanks to Erebus.

If upgrading to newer version, you only need vncview.exe as long as the currently installed directory still has the vnc viewer and psservice.

That's probably the end of my VNC changes, next will be a major overhaul to add Remote Desktop support and to fix user rights issues which will probably take me a little longer to implement. You don't need to know every change anyway, I'll just make and update the readme file from now on.

Share this post


Link to post
Share on other sites

dam ... would have liked to have had a look at this, but the file is no longer available.

Perhaps you could use VNC Neighborhood

Share this post


Link to post
Share on other sites

Perhaps you could use VNC Neighborhood

thanks for the link, but i wanted to incorporate some of the features into my own apps ;)

i just noticed that the author is still active, perhaps he still has a copy (fingers crossed)


ask a silly question and remain a fool for 5 minutes...don't ask, and remain a fool for life__JD - YTS | VNC2Me - Secure remote Desktop Support Solutions

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

i just noticed that the author is still active, perhaps he still has a copy (fingers crossed)

I hope so too. I use VNC a lot and I would like to automate it.

Edited by dalisuit

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

dam ... would have liked to have had a look at this, but the file is no longer available.

I wish it were still available too, I'd like to see it... I did find an old version of it in my email, from 9/24/2004. Maybe you'll find it useful.

vncview.zip

Edited by archrival

Share this post


Link to post
Share on other sites

Thank you, will check it out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0