Go Back   CodeCall Programming Forum > Software Development > General Programming
Register Blogs Search Today's Posts Mark Forums Read

General Programming Non language specific and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-05-2009, 10:28 PM
Programming Professional
 
Join Date: Nov 2007
Posts: 256
Panarchy is an unknown quantity at this point
Question HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

Hi

I need some help creating a script that can gather IP Address from within .RDP or .vRD files, then output to the IP Address to a text file.

I then need that IP Address from that text file to be automatically inputted into a .cpp file, subsequently compiled and given the same name as the .RDP or .vRD file.

The .cpp file is basically a batch file (without the Command-Prompt window) which launches vnc viewer (UltraVNC) with username and password, unlike .VNC files which are limited to password ONLY authentication. This dual authentication is achieved using the following;
vncviewer.exe /connect xx.xx.xx.xx:5900 /user USERID /password PASSWORD

lscrat was used to do the /connect etc.

Please give me an example of a script which can gather the IP Address & Name from .RDP or .vRD files, then input both the IP Address & Name into a logfile, subsequently copying the IP Address into a .cpp file, compiling it, then renaming the *.exe to the name which correlates to the IP Address.

Thanks in advance,

Panarchy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-06-2009, 03:16 AM
dargueta's Avatar
Code Warrior
 
Join Date: Oct 2007
Age: 19
Posts: 2,602
dargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

You want to use regular expressions. I'd use Perl for this just because I like its regex and because I don't know how to use them in other languages. I'm sure that there's someone out there who knows how to use them in C/C++ better than I.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-06-2009, 03:30 PM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

boost::regex has perl-style regular expressions and is well-documented.
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-06-2009, 07:34 PM
Programming Professional
 
Join Date: Nov 2007
Posts: 256
Panarchy is an unknown quantity at this point
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

dargueta & WingedPanther: I don't care which language it is (heck, choose Delphi or Assembly!!!), as long as it works. Doesn't need to have an interpreter/environment for Windows, just as long as the end product (the *.exe) is compatible with Windows.

So please try your best, to give me a coding example which exports both the name and IP Address from .RDP or .vRD files, into a .cpp file, subsequently compiling that with the name & IP Address of the .RDP or .vRD file.

Thanks in advance,

Panarchy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-06-2009, 08:23 PM
dargueta's Avatar
Code Warrior
 
Join Date: Oct 2007
Age: 19
Posts: 2,602
dargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

What exactly do you mean by "exporting into a .cpp file"?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-06-2009, 09:34 PM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

I'm not familiar with the .RDP or .VRD file format. Getting that would be the first step.
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-06-2009, 09:48 PM
dargueta's Avatar
Code Warrior
 
Join Date: Oct 2007
Age: 19
Posts: 2,602
dargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

I suspect that they're formatted like .INI files, but I'm not sure. Could you send us a sample file?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-06-2009, 10:06 PM
Programming Professional
 
Join Date: Nov 2007
Posts: 256
Panarchy is an unknown quantity at this point
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

By exporting to an .cpp, I mean inputting data to the exact line of the IP Address, changing it, then compiling.

A friend has them stored in a .csv file though, I'm just waiting for him to send it to me, then I'll give you a copy.

In the meantime, can you predict how it would work?

Thanks in advance,

Panarchy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 06-06-2009, 10:15 PM
dargueta's Avatar
Code Warrior
 
Join Date: Oct 2007
Age: 19
Posts: 2,602
dargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud ofdargueta has much to be proud of
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

Probably pattern matching and replacing. I found a pretty good tutorial on regular expressions you might want to look at.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 06-07-2009, 10:22 AM
Newbie
 
Join Date: May 2009
Posts: 24
ikonia is an unknown quantity at this point
Re: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

if your friend has the info on a cvs file would it not be more useful to use something like excel and a vb style macro to filter them out into different files ?

Or as suggested if you have it in a cvs file, do a while loop in perl and then use the substitute functionality within perl to find and replace the old ip address with the next one then issue the compiler function before moving ontot he next loop.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -5. The time now is 09:51 AM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0