• Automation (VBS)

    Author
    Topic
    #395538

    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

    Viewing 3 reply threads
    Author
    Replies
    • #734861

      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

      • #734867

        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

      • #734868

        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

    • #734862

      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

    • #734923

      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 freeware application here that might be of interest.

      Alan

      • #734933

        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

        • #734951

          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.)

        • #734952

          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.)

        • #734953

          I believe you are not. Or if you prefer, I don’t believe that you are. grin 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

        • #734954

          I believe you are not. Or if you prefer, I don’t believe that you are. grin 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

        • #735086

          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.

          • #735786

            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

            • #735831

              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 free 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.

            • #735911

              Cheers, will have a go later!

              Jambo

            • #735832

              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 free 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.

          • #735787

            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

        • #735087

          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.

      • #734934

        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

    • #734924

      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 freeware application here that might be of interest.

      Alan

    Viewing 3 reply threads
    Reply To: Automation (VBS)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: