Closed Thread
Page 1 of 7 123 ... LastLast
Results 1 to 10 of 70

Thread: HELP: Script to gather IP Address from .RDP then compile to .exe for VNC

  1. #1
    Panarchy is offline Programming Professional
    Join Date
    Nov 2007
    Posts
    259
    Rep Power
    0

    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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,496
    Blog Entries
    8
    Rep Power
    58

    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.

  4. #3
    Join Date
    Jul 2006
    Posts
    16,448
    Blog Entries
    74
    Rep Power
    143

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    Panarchy is offline Programming Professional
    Join Date
    Nov 2007
    Posts
    259
    Rep Power
    0

    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

  6. #5
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,496
    Blog Entries
    8
    Rep Power
    58

    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"?

  7. #6
    Join Date
    Jul 2006
    Posts
    16,448
    Blog Entries
    74
    Rep Power
    143

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  8. #7
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,496
    Blog Entries
    8
    Rep Power
    58

    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?

  9. #8
    Panarchy is offline Programming Professional
    Join Date
    Nov 2007
    Posts
    259
    Rep Power
    0

    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

  10. #9
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,496
    Blog Entries
    8
    Rep Power
    58

    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.

  11. #10
    ikonia is offline Newbie
    Join Date
    May 2009
    Posts
    24
    Rep Power
    0

    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.

Closed Thread
Page 1 of 7 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 04-30-2011, 04:12 PM
  2. [HELP] convert Perl script to Bash shell script
    By Egypte in forum Linux Programming and Scripting
    Replies: 2
    Last Post: 04-24-2011, 05:37 PM
  3. Can't Compile
    By tedmp0816 in forum C and C++
    Replies: 4
    Last Post: 10-20-2009, 01:00 AM
  4. PHP: Gather ALL Post Variables
    By phpforfun in forum PHP Development
    Replies: 7
    Last Post: 01-30-2009, 02:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts