Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Nov 2002
    Location
    Port Talbot, Wales
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automation (VBS)

    I have wrote a simple script in VBS to read values from the registry, install a patch, copy some files accross after the patch has finished, create a few shortcuts and then write some values back to the registry. I wanted to create an executable to do this for me as the script needs to be run on a about 500 pc's by the user and i do not want the user messing around with VBS or any programming language. Finally my questions are:

    1. - Can it be done?
    2. - What would be the best language to write the executable in so that it will run on any Windows based pc?
    3. - Any sample code would be much appreciated as i have only wrote VB and don't know how to read from or write to the registry.

    Thanks in advance
    Jambo

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    In terms of sample code for reading from and writing to the registry - the Scripting Runtime downloadable from Microsoft here has worked examples in its Help Files. HTH
    Gre

  3. #3
    Star Lounger
    Join Date
    Nov 2002
    Location
    Port Talbot, Wales
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    Cheers unkamunka but i have already wrote a .VBS file to do it but don't really want to use this as i know the end user will mess around with it and maybe even start writing their own .vbs files. Also i want to disable all users from running Vbs files later on.

    Thanks
    Jambo

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    A few possibilities come to mind. The most obvious is to rewrite in VB (virtually the same as VBS in this context) and make a "proper" executable.

    The Script Encoder will make it very difficult for the casual user to get to the source code.

    There's a <img src=/S/free.gif border=0 alt=free width=30 height=15>ware application here that might be of interest.

    Alan

  5. #5
    Star Lounger
    Join Date
    Nov 2002
    Location
    Port Talbot, Wales
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    I had thought of that but i believe that vb executables use runtime dll's, not all of the pc's have these installed. Please tell me if i am talking crap.

    Thanks
    Jambo

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Automation (VBS)

    Yes, a VB app requires that the VB runtime DLL's are installed. You can create an installation package that will install these if they are not found on the target PC.

    Borland Delphi can create applications (.exe) that are completely stand-alone (at least, it could the last time I looked at it, which is a while ago.)

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    I believe you are not. Or if you prefer, I don't believe that you are. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> Must admit, I didn't consider the VB runtimes - I guess I assume all PCs have them nowadays. Just looked for the Script Encoder BTW, and a more direct URL is here.

    Good luck with it. I'd be interested in your final solution.

    Alan

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Automation (VBS)

    All PCs with Office 2000 or higher or Visual Studio 6 or higher or any of the Office apps for those versions already have the VB6 runtime files. If you have VB6 Pro, you can package an installer to include the 13Mb runtime files.
    Charlotte

  9. #9
    Star Lounger
    Join Date
    Nov 2002
    Location
    Port Talbot, Wales
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    cheers guys, i think i'll have a go with Delpi. Are there any other packages that will compile a standalone exe that won't require an installer. I don't want the end user to be installing anything, i just want them to be able to run an exe file that will do the lot without worring what Windows OS is on the pc.

    Thanks
    Jamie

  10. #10
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    If you're wanting to avoid any runtime support files, you may have to opt for using API calls and compiling a "genuine" standalone using something like the <img src=/S/free.gif border=0 alt=free width=30 height=15> lcc-win32 compiler. Even so, there may still be issues (e.g. registry) between different O/S versions (NT vs. 98 for instance). This would be true no matter how you implemented it though.

    Alan

    Edited - I see you haven't had any responses to the third part of your question. I've done sweet little in the way of manipulating the registry programmatically, but this SDK link at MSDN might provide the necessary API function calls such as RegOpenKey(), RegSaveKey() ... to do what you're after.

  11. #11
    Star Lounger
    Join Date
    Nov 2002
    Location
    Port Talbot, Wales
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation (VBS)

    Cheers, will have a go later!

    Jambo

Posting Permissions

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