+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 39
Scripts Thread, Need help in sorting these scripts out and possible better solutions. in Coding and Web Development; What I'm looking for the VBScript to do is: 1. Checks to make sure it's a Windows XP, Windows 2003, ...
  1. #1

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Need help in sorting these scripts out and possible better solutions.

    What I'm looking for the VBScript to do is:

    1. Checks to make sure it's a Windows XP, Windows 2003, Vista, Windows 7 OS letting the user know the OS is not supported, and exits.
    2. Checks to make sure it is a 32bit OS, letting the user know that 32bit OS is only supported, and exits.
    3. Set specific registry settings if the OS is XP or 2003
    4. Set specific registry settings if the OS is Vista or Windows 7
    5. Change the Computer name
    6. Create a user account, set access to Administrator, set the password, and set the password to never expire.
    6A. If the user account does exist, check the access level and set to Administrator if it's not already set, set the password, and set the password to never expire.

    All this will be happening on a local system. I found some scripts but I'm not at all savvy on creating scripts. On some of the routines I've found a couple scripts.

    I'm working on an install guide and these things need to be set on a Fresh OS install prior to starting the guided install. Any help would be greatly appreciated.

    Is there a way to open a window for the user to inform them of what it is doing along the way?

    Hopfully someone can get this straightened out, possibly have a better solution, or point me into the correct direction.


    Check for OS - Only allow XP, 2003, Vista, Windows 7
    ================================================== ==
    Code:
    msgbox GetOS 
    
    Function GetOS() 
    'WMI is required for this script to function 
    Dim strComputer, strWMIOS 
    'If you only want to use locally, remove the inputbox and make strComputer = "." 
    strComputer = Inputbox("Input the name of the remote computer or hit enter for this PC.") 
        If strComputer = "" then 
            strComputer = "." 
        End if 
    
    Dim objWmiService : Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2") 
    Dim strOsQuery : strOsQuery = "Select * from Win32_OperatingSystem" 
    Dim colOperatingSystems : Set colOperatingSystems = objWMIService.ExecQuery(strOsQuery) 
    Dim objOs 
    Dim strOsVer 
    
        For Each objOs in colOperatingSystems 
            strWmios = objOs.Caption & " " & objOs.Version 
        Next 
    
        Select Case True 
        'Add more info to the 98 and 95 to get the specific version. i.e. 98SE 95 a,b,or c 
            Case InStr(strWmiOS, "2000 Server") > 1 : GetOS = "2KSRV" 
            Case InStr(strWmiOS, "2003, Standard") > 1 : GetOS = "2K3SRV" 
            Case InStr(strWmiOS, "2003, Enterprise") > 1 : GetOS = "2K3ENTSRV" 
           Case InStr(strWmiOS, "2000 Advanced Server") > 1 : GetOS = "2KADVSRV" 
           Case InStr(strWmiOS, "Windows NT") > 1 : GetOS = "NT4" 
           Case InStr(strWmiOS, "Windows 2000") > 1 : GetOS = "W2K" 
           Case InStr(strWmiOS, "Windows XP") > 1 : GetOS = "WXP" 
           Case Else : GetOS = "Unknown" 
        End Select 
    End Function

    Check for 32 bit or 64bit 0nly alloec 32bit
    ===========================================
    Code:
    On Error Resume Next
    
    Dim WshShell
    Dim OsType
    
    Set WshShell = CreateObject("WScript.Shell")
    
    OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
    
    If OsType = "x86" then
    wscript.echo "Windows 32bit system detected"
    elseif OsType = "AMD64" then
    wscript.echo "Windows 64bit system detected"
    end if
    Code:
    If OsType = "x86" then
    wscript.echo "Windows 32bit system detected"
    elseif OsType = "AMD64" then
    wscript.echo "Windows 64bit system detected"
    end if

    Code:
    info = get_OS_Bit("server1")
     
    
    wscript.echo info
     
    
    Function get_OS_Bit(strComputer)
     const HKEY_LOCAL_MACHINE = &H80000002
     Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
     strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
     strValueName = "Identifier"
     
    
     oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
     if (instr(strValue,"x86")) then
      Wscript.echo "OS running on : " & strComputer & " is 32 bit."
      get_OS_Bit="32"
     elseif (instr(strValue,"64")) then
      get_OS_Bit="64"
      Wscript.echo "OS running on : " & strComputer & " is 64 bit."
     else
      get_OS_Bit="NotSure"
      wscript.echo "Not sure."
     end if
    End Function

    Registry settings to set if XP or 2003
    ======================================
    Code:
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "Hidden"=dword:00000001
    "HideFileExt"=dword:00000000

    Registry settings to set if Vista or Windows 7
    ==============================================
    Code:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000000
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "Hidden"=dword:00000001
    "HideFileExt"=dword:00000000

    Change the computer name
    ========================
    Code:
    sNewName = "put new name here" 
    
    Set oShell = CreateObject ("WSCript.shell" ) 
    
    sCCS = "HKLM\SYSTEM\CurrentControlSet\" 
    sTcpipParamsRegPath = sCCS & "Services\Tcpip\Parameters\" 
    sCompNameRegPath = sCCS & "Control\ComputerName\" 
    
    With oShell 
    .RegDelete sTcpipParamsRegPath & "Hostname" 
    .RegDelete sTcpipParamsRegPath & "NV Hostname" 
    
    .RegWrite sCompNameRegPath & "ComputerName\ComputerName", sNewName 
    .RegWrite sCompNameRegPath & "ActiveComputerName\ComputerName", sNewName 
    .RegWrite sTcpipParamsRegPath & "Hostname", sNewName 
    .RegWrite sTcpipParamsRegPath & "NV Hostname", sNewName 
    End With ' oShell 
    
    MsgBox "Computer name changed, please reboot your computer"

    Create a user account, set to Administrator, and change password if user exists, Password never expires
    ================================================== ================================================== ===
    Code:
    'this section creates the new username if it doesn't exist
    QueryForUser("username")
    
                    Set objNetwork = CreateObject("Wscript.Network")
                    strComputer = objNetwork.ComputerName
                    Set objComputer = GetObject("WinNT://" &strComputer)
    
                    Set colAccounts = GetObject("WinNT://" & strComputer & "")
                    Set objUser = colAccounts.Create("user", "username")
                    objUser.SetPassword "password"
                    objUser.Put "UserFlags", 65600 '
                    objUser.SetInfo
    
    'add to administrators group
                    Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
                    Set objUser = GetObject("WinNT://" & strComputer & "/username,user")
                    objGroup.Add(objUser.ADsPath)
    
               msgbox "username was created"
    
    'this section just changes the password if the user exists
     Sub QueryForUser(strUserName)
        Set objlocal = GetObject("WinNT://.")
        objlocal.Filter = Array("user")
        For Each User In objlocal
            If lcase(User.Name) = lcase(strUserName) Then
    
                    strComputer = "."
                    Set objUser = GetObject("WinNT://" & strComputer & "/username, user")
                    objUser.SetPassword "password"
                    objUser.SetInfo
    
                msgbox User.Name & " already exists." & vbCrLf & "The password was re-set."
                WScript.Quit
            End If    
        Next
     End Sub

    Code:
     '---------------------------------------------------------------------
     '
     '   The following script can be used to create a local
     '   user account and add it to the local Administrators
     '   group. To use, change the strLocalUserName to the desired
     '   name and change PASSWORD to password for the account.
     '
     '   Please note, there is a limitation with the NET USER command
     '   where you are unable to set an account as 'never expires'.
     '   The bottom part of the script works arounds this.
     '
     '---------------------------------------------------------------------
     
     Set objShell = CreateObject ("WScript.Shell")
     Set Shell = Nothing on error resume next
     '---------------------------------------------------------------------
     '         Create local account
     Set oWshNet = CreateObject("WScript.Network")
     strComputer = oWshNet.ComputerName
     
     strLocalUserName = "LocalAdmin"
     strGroupname = "Administrators"
     
     WScript.Sleep(900)
     
     On Error Resume Next
     Set objUser = GetObject("WinNT://" & strComputer & "/" & strLocalUserName & ",user")
     If Err.Number <> 0 Then
     ' User account does not exist, create it.
     objShell.Run "NET USER "&strLocalUserName&" PASSWORD /ADD " _
     & "/ACTIVE:YES /COMMENT:""Local IT Support Account"" /FULLNAME:" _
     & strLocalUserName &" /expires:never", 0, True
     End If
     
     On Error Resume Next ' Try again
     Set objUser = GetObject("WinNT://" & strComputer & "/" & strLocalUserName & ",user")
     If Err.Number = 0 Then
     
     ' Connect to the group
     Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroupname)
     
     ' Add the user account to the group
     ' Use error handling in case it is a member already
     On Error Resume Next
     objGroup.Add(objUser.ADsPath)
     WScript.sleep 600
     objGroup.Add(objUser.ADsPath)
     ' Error -2147023518 is "The specified account name is already
     ' a member of the local group."
     
     End If
    
     
     '-----------------------------------------
     '          Set Account password to never expire
     '       This is done externally due to NET USER limitations
     
     Const ufDONT_EXPIRE_PASSWD = &H10000
     objUserFlags = objUser.Get("UserFlags")
     if (objUserFlags And ufDONT_EXPIRE_PASSWD) = 0 then
      objUserFlags = objUserFlags Or ufDONT_EXPIRE_PASSWD 
      objUser.Put "UserFlags", objUserFlags
      objUser.SetInfo
     end if

    TIA....

  2. #2

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Wow, I was recommended this site. Does anyone have a suggestion where I could get some help on this?

  3. #3

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,686
    Thank Post
    333
    Thanked 513 Times in 481 Posts
    Rep Power
    178
    Quote Originally Posted by mesteele101 View Post
    Wow, I was recommended this site. Does anyone have a suggestion where I could get some help on this?
    Speaking for myself (Others may disagree), but I'm more than happy to "help" develop a script for you, I understand you may not be script savvy, however you've not even tried to put one together so far. You may not understand all of it, but try a section if it works add a bit more, if it doesn't ask for help on it. Rather than just asking us to make the whole thing.

    And this is also an IT professional website, It's not really designed to develop software for your company to sell (WINSNORT.com :: Home of the Windows Intrusion Detection System (WinIDS)! from your profile).

    Steve

  4. #4

    Join Date
    Apr 2011
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Try this

    Code:
    On Error Resume Next
    
    Dim objWShell
    
    Set objWShell = WScript.CreateObject("WScript.Shell")
    
    getVersionNumber = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
    getOsType = objWShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
    
    If getOsType = "x86" Then
       If getVersionNumber = "6.1" Or "6.0" Then
          objWShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", 0, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 1, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", 0, REG_DWORD
       ElseIf getVersionNumber = "5.1" Or "5.0" Then
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 1, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", 0, REG_DWORD
       Else
          Msgbox "The OS is not 7, Vista, XP, or 2K3. The OS Version Number is: " & getVersionNumber
          WScript.Quit
       End If
    Else
       Msgbox "Unsupported processor architecture: " & getOsType &". Only 32 bit is supported"
       WScript.Quit
    End If
    
    Do
       computerName = InputBox("Enter computer name", "VBScript")
    Loop While computerName = ""
    
    If computerName <> "" Then
       If getVersionNumber = "6.1" Or "6.0" Then
          Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
          Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
    
          objComputer = "."
          For Each objComputer In colComputers
             err = objComputer.Rename(computerName)
          Next
    
          If err <> 0 Then
             Msgbox "There was an error renaming the machine. Please restart, and try again."
          Else
             Msgbox "Machine successfully renamed to " & computerName
          End If
    
          Set objWMIService = Nothing
          Set colComputera = Nothing
       ElseIf getVersionNumber = "5.1" or "5.0" Then
          objWShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName", computerName
          objWShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ParameterS\NV Hostname", computerName
       Else
          Msgbox "The OS is not 7, Vista, XP, or 2K3. The OS Version number is: " & getVersionNumber
       End If
    Else
       Msgbox "Please provide a computer name"
    End If
    
    Do
       accUserName = InputBox("Enter user name", "VBScript")
       accUserPass = InputBox("Enter user password (can be blank)", "VBScript")
    Loop While accUserName = ""
    
    If accUserName <> "" Then
       Set objlocal = GetObject("WinNT://.")
       objlocal.Filter = Array("user")
       For Each User In objlocal
          If LCase(User.Name) = LCase(accUserName) Then
             Set objUser = GetObject("WinNT://./" & accUserName & ", user")
             objUser.SetPassword accUserPass
             objUser.SetInfo
             Msgbox User.Name & " already exists. The password was re-set."
          Else
             Set objComp = GetObject("WinNT://./")
             Set objUser = objComp.Create("user", accUserName)
             objUser.SetPassword accUserPass
             objUser.AccountDisabled=False
             objUser.Put "UserFlags", 65600
             objUser.SetInfo
             Msgbox User.Name & " doesn't exist. Created the account. The password is: " & accUserPass
          End If
       Next
    Else
       Msgbox "Please provide a user name"
    End If
    
    Msgbox "Restarting computer"
    objWShell.Run "shutdown /r /t 10 /f /d P:4:2"
    
    Set objWShell = Nothing
    Creating user may not work on xp, and renaming computer may not work on 7

  5. #5

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by Steve21 View Post
    Speaking for myself (Others may disagree), but I'm more than happy to "help" develop a script for you, I understand you may not be script savvy, however you've not even tried to put one together so far. You may not understand all of it, but try a section if it works add a bit more, if it doesn't ask for help on it. Rather than just asking us to make the whole thing.

    And this is also an IT professional website, It's not really designed to develop software for your company to sell (WINSNORT.com :: Home of the Windows Intrusion Detection System (WinIDS)! from your profile).

    Steve
    I didn’t expect anyone to build a script from scratch, and that’s why I did some research on the web and acquired single scripts for all the items I needed.

    I’m sure that I could have spent hours in testing, developing and fumbling my way through, but in the 10 years of furnishing FREE installation guides to the public I never needed a script to accomplish any of this. I would just walk the user through step by step on most of these things.

    I really don’t need to learn Visual Basic; however I can usually hack at some of this stuff. As important as these tasks are, I would rather someone else that knew what they were doing, complete it.

    The “(WINSNORT.com :: Home of the Windows Intrusion Detection System (WinIDS)! from your profile)”

    The ‘WinIDS’ is FREE to everyone. If the script will work without user intervention it will be included with the FREE package.
    Last edited by mesteele101; 29th July 2011 at 01:28 PM.

  6. #6

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    kaujazz

    I have some time on Sunday to give this a try. The Computer renaming did work on 7 but I never tested on XP. I have all the OS's on VM's and will test to see how things go.

    Thank you so much...

  7. #7

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I had some time and after running on Windows 7 I got an error:

    Line: 28
    Char: 63
    Error: Expected end of statement

    The line 28 I have is:
    Code:
       computerName = InputBox("Enter computer name", "VBScript") Loop While computerName = ""
    For this script the Computer name will always be 'WinIDS', and if the computer name already 'WinIDS' it can jump over the task.

    The User Name will always be 'Operator', and the password will always be 'p@ss'. I don't want to give them any input options. Basically just do the task if it doesn't exist, and jump over if it does.

    It might be nice to have a message box open and indicate what task is happening as it progresses. Also a message at the end telling them that a reboot is necessary and a bottom labeled 'Reboot Now...’, so they can know that the process has completed successfully, and an automatic reboot in 60 seconds, with a countdown?

    This message system is not really necessary, just a thought I had.

    Thanks...
    Last edited by mesteele101; 30th July 2011 at 02:21 AM.

  8. #8

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,686
    Thank Post
    333
    Thanked 513 Times in 481 Posts
    Rep Power
    178
    Quote Originally Posted by mesteele101 View Post
    I didn’t expect anyone to build a script from scratch, and that’s why I did some research on the web and acquired single scripts for all the items I needed.

    I’m sure that I could have spent hours in testing, developing and fumbling my way through, but in the 10 years of furnishing FREE installation guides to the public I never needed a script to accomplish any of this. I would just walk the user through step by step on most of these things.

    I really don’t need to learn Visual Basic; however I can usually hack at some of this stuff. As important as these tasks are, I would rather someone else that knew what they were doing, complete it.

    The “(WINSNORT.com :: Home of the Windows Intrusion Detection System (WinIDS)! from your profile)”

    The ‘WinIDS’ is FREE to everyone. If the script will work without user intervention it will be included with the FREE package.
    I never said spend hours and hours on it, all I said was it would be nice if you attempted it :P End of day, if you need more scripts in future even learning a bit about them will help you. No-ones expecting you to learn the entire language.

    Anyway, Your getting the error on line 28 as you copied a line wrong.

    Code:
    computerName = InputBox("Enter computer name", "VBScript") Loop While computerName = ""
    Should be 2 lines of code:

    Code:
    computerName = InputBox("Enter computer name", "VBScript") 
    Loop While computerName = ""
    Anyway the edits you wanted (Think it should work, not tested)

    Code:
    On Error Resume Next
    
    Dim objWShell
    
    Set objWShell = WScript.CreateObject("WScript.Shell")
    
    getVersionNumber = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
    getOsType = objWShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
    
    If getOsType = "x86" Then
       If getVersionNumber = "6.1" Or "6.0" Then
          objWShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", 0, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 1, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", 0, REG_DWORD
       ElseIf getVersionNumber = "5.1" Or "5.0" Then
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden", 1, REG_DWORD
          objWShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt", 0, REG_DWORD
       Else
          Msgbox "The OS is not 7, Vista, XP, or 2K3. The OS Version Number is: " & getVersionNumber
          WScript.Quit
       End If
    Else
       Msgbox "Unsupported processor architecture: " & getOsType &". Only 32 bit is supported"
       WScript.Quit
    End If
    
    computerName = "WinIDS"
    
    If computerName <> "" Then
       If getVersionNumber = "6.1" Or "6.0" Then
          Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
          Set colComputers = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
    
          objComputer = "."
          For Each objComputer In colComputers
             err = objComputer.Rename(computerName)
          Next
    
          If err <> 0 Then
             Msgbox "There was an error renaming the machine. Please restart, and try again."
          Else
             Msgbox "Machine successfully renamed to " & computerName
          End If
    
          Set objWMIService = Nothing
          Set colComputera = Nothing
       ElseIf getVersionNumber = "5.1" or "5.0" Then
          objWShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName", computerName
          objWShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\ParameterS\NV Hostname", computerName
       Else
          Msgbox "The OS is not 7, Vista, XP, or 2K3. The OS Version number is: " & getVersionNumber
       End If
    Else
       
    End If
    
    
    accUserName = "Operator"
    accUserPass = "p@ss"
    
    If accUserName <> "" Then
       Set objlocal = GetObject("WinNT://.")
       objlocal.Filter = Array("user")
       For Each User In objlocal
          If LCase(User.Name) = LCase(accUserName) Then
             Set objUser = GetObject("WinNT://./" & accUserName & ", user")
             objUser.SetPassword accUserPass
             objUser.SetInfo
             Msgbox User.Name & " already exists. The password was re-set."
          Else
             Set objComp = GetObject("WinNT://./")
             Set objUser = objComp.Create("user", accUserName)
             objUser.SetPassword accUserPass
             objUser.AccountDisabled=False
             objUser.Put "UserFlags", 65600
             objUser.SetInfo
             Msgbox User.Name & " doesn't exist. Created the account. The password is: " & accUserPass
          End If
       Next
    Else
       
    End If
    
    Msgbox "Restarting computer"
    objWShell.Run "shutdown /r /t 10 /f /d P:4:2"
    
    Set objWShell = Nothing
    Red bits the bits changed, just directly setting vars, not asking for input (and removed the error messages as they're already being set)

    In terms of it giving message boxes, and auto restart it's already set to do that, Does that mean it's not working? or you want it to work differently?

    Steve

  9. #9

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,660
    Thank Post
    1,612
    Thanked 1,865 Times in 1,383 Posts
    Blog Entries
    2
    Rep Power
    400
    Why not pull all scripts in 1 section then have a batch script calling each one individually?

  10. #10

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Steve21;

    Creating account it states:

    Guest doesn't exisit. Create the account. The password is: p@ss

    Operator1234 doesn't exisit. Create the account. The password is: p@ss

    Both of those accounts exist prior to running the script.

    I's not creating the password, but that might be becuse of the above problem?

    Thanks...
    Last edited by mesteele101; 30th July 2011 at 12:55 PM.

  11. #11

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Nephilim;

    I'm thinking to many moving parts. I just need it to go right down the line, execute, and reboot. I'm basically allowing the user to creat the OS any way they want then in one swoop, change or create the items that the WinIDS needs in order to run in a known orderly fashion. I just need to make sure everyone that installs the WinIDS is on the same page before starting the WinIDS install.

  12. #12

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,686
    Thank Post
    333
    Thanked 513 Times in 481 Posts
    Rep Power
    178
    That's because the way the script is written is a bit silly.

    You're searching through each user aka guest and operator1234.

    If that name equals operator set password
    Else say it doesn't exist (wrong name is given out and make user)

    Which isn't really correct, as you only check one account before making it. You should loop all accounts, then at end if it doesn't exist make it

    Steve

  13. #13

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Steve21;

    Ok, also it's not writing the registry values?

    Testing on Windows 7

    Thanks...

  14. #14

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I think I'm stuck and I'm not real sure what I'm doing here. I’m not sure what it’s worth but $50 from PayPal is doable? Or, if someone knows a reputable site that does this type of programming for a fee.

    I was thing a simple menu that the user could either execute a single item, or allow the script to execute all the items at once.

    1) The first thing it needs to do is check if the OS is Windows XP, Server 2003, or Windows 7
    Anything else, it exits stating Your OS version <version> not supported.

    2) Next it needs to check if its 32bit or 64bit architecture.
    Exits if it’s not 32bit stating unsupported processor architecture: <OS Type>. Only 32bit supported.

    3) Set specific registry settings if the OS version is XP or 2003

    4) Set specific registry settings if the OS version is Windows 7

    5) Change the computer name fully based on specific OS (XP, 2003, or Windows 7)

    5) Check for user account and if there is no ‘Operator’ account, then create it, giving it Administrator access, set the password to ‘pass’, and then set the password to never expire.
    If there is already an ‘Operator’ account then give it Administrator access, set the password to ‘pass’, and then set the password to never expire.

    6) Then to state system will reboot in 60 seconds, and to be SURE to login with user ‘Operator’ and use password ‘pass’.

    TIA…

  15. #15

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,630
    Thank Post
    890
    Thanked 1,314 Times in 798 Posts
    Blog Entries
    1
    Rep Power
    441
    Just a heads up mesteele, I will take a gander at options tomorrow but its rather late right now for my brain to work
    Welcome to EduGeek btw

SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Need Help with folder ownership in windows 7
    By mrb-solutions in forum How do you do....it?
    Replies: 9
    Last Post: 2nd August 2010, 10:28 AM
  2. Replies: 1
    Last Post: 10th March 2010, 11:56 AM
  3. We need a new website and I need help... please?
    By elsiegee40 in forum EduGeek Joomla 1.5 Package
    Replies: 9
    Last Post: 20th January 2009, 08:53 PM
  4. Replies: 1
    Last Post: 2nd July 2008, 04:20 PM
  5. Need help with Plasma screen install and audio on PE Suite
    By tosca925 in forum How do you do....it?
    Replies: 5
    Last Post: 26th June 2008, 11:41 PM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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