none
User Input from Text File RRS feed

  • Question

  • Hello

    I would like to incorporate code into this to allow the script I found on the internet to pull input from a txt file and then wait for the script to end before using the next entry in the text file and run until all entries in the text file have been used.

    Any help would be great thx.

    Jason


    ' Get Options from user
    GetOptions



    If (bInvalidArgument) Then
        WScript.Echo"Invalid Arguments" & VbCrLf
        bDisplayHelp = True
    EndIf

    If (bDisplayHelp) Then
        DisplayHelp
    Else
        If (bCheckVersion) Then
            CheckVersion
        EndIf
        If (strComputer = "") Then
            strComputer = InputBox("What Computer do you want to document (default=localhost)","Select Target",".")
        EndIf
        If (strComputer <> "") Then
            ' Run the GatherWMIInformation() function and return the status
            ' to errGatherInformation, if the function fails then the
            ' rest is skipped. The same applies to GatherRegInformation
            ' if it is successful we place the information in a
            ' new word document
            errGatherWMIInformation = GatherWMIInformation()
            If (errGatherWMIInformation) Then
                If (bDoRegistryCheck) Then
                    errGatherRegInformation = GatherRegInformation
                EndIf
                GetWMIProviderList
            Else
                WScript.Quit(999)
            EndIf

            If (bHasMicrosoftIISv2) Then' Does the system have the WMI IIS Provider
                GatherIISInformation
            EndIf

            SystemRolesSet
            
            If (errGatherWMIInformation) Then
                SelectCase strExportFormat
                    Case"word"
                        PopulateWordfile
                    Case"xml"
                        PopulateXMLFile
                EndSelect
            EndIf
        EndIf
    EndIf

    Thursday, March 13, 2014 10:57 PM

Answers

  • Unfortunately the script is too long to be posted but can be found at http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I asked about.

    Jason

    I do not know which script you had in mind but the one I looked at had 1,600 lines of code. As you say, posting it here would be inappropriate. At the same time it is unrealistic to ask for help for such a large script. Asking the author is one option. The other option would be to identify the module you wish to modify, analyse it until you fully understand it, modify it so that you can run it in a stand-alone manner, then post your question here. You will probably find that you can answer the question yourself after analysing the code!
    Friday, March 14, 2014 2:01 PM

All replies

  • Since the script you posted contains only fragments of the whole thing it is not possible to give you a good answer. Note also that if you wish to modify someone else's script then you must understand exactly what it does and how it works.
    Thursday, March 13, 2014 11:19 PM
  • I agree with Forest.  What you have posted is useless.

    Start here: http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx


    ¯\_(ツ)_/¯

    Thursday, March 13, 2014 11:33 PM
  • Hello Forest

    Unfortunately the script is too long to be posted but can be found at http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I asked about.

    Jason

    Friday, March 14, 2014 1:36 PM
  • Hello JRV

    Unfortunately the script is too long to be posted but can be found at http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I asked about.

    Jason

    Friday, March 14, 2014 1:37 PM
  • Unfortunately the script is too long to be posted but can be found at http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I asked about.

    Jason

    I do not know which script you had in mind but the one I looked at had 1,600 lines of code. As you say, posting it here would be inappropriate. At the same time it is unrealistic to ask for help for such a large script. Asking the author is one option. The other option would be to identify the module you wish to modify, analyse it until you fully understand it, modify it so that you can run it in a stand-alone manner, then post your question here. You will probably find that you can answer the question yourself after analysing the code!
    Friday, March 14, 2014 2:01 PM
  • I am familiar with that script.  It has been around for a long time.  It is a very large script that attempt to do everything.  Either ask the author for help or write your own script.

    You can also just call the script in a loop without modifying it.

    If you are not a technician you might want to find a consultant to help you with the technical parts.


    ¯\_(ツ)_/¯

    Friday, March 14, 2014 2:04 PM