Jump to content

mesteele101

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by mesteele101

  1. Here is the complete script. I have't added the 'case' to it. I'm having a couple of problems: 1) It seems to be looping through some of the routines. 2) If the user has to be created then the HKCU registry settings that are being created won't apply for the newly created user There might be better ways to code some of the routines All I can do with this type of code is hack at it. 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") getProductName = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") ComputerName = "WinIDS" accUserName = "Cracker" accUserPass = "p@ss" 'This tests for x86 processor architecture, and exits if not. Install is not 64bit capable. If getOsType = "x86" Then 'This tests for Windows Windows 7 (6.1), and continues script if not. If getVersionNumber = "6.1" Then msgbox "Version detected is : " & getVersionNumber 'This forces UAC to be disabled during script execution. If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 Else 'Sets registry to disable ELUA, Show Hidden files and folders, and display file extensions. objWShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", "0", "REG_DWORD" 'The below two can not be created for user Operator if that account has to be created. 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" 'This changes the computer name for Windows 7. 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 Set objWMIService = Nothing Set colComputera = Nothing End if ElseIf getVersionNumber = "5.1" or getVersionNumber = "5.2" Then msgbox "Version detected is : " & getVersionNumber 'This sets registry to Show Hidden files and folders, and display file extensions. 'The below two can not be created for user Operator if that account has to be created. 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" 'This changes the computer name for Windows XP or Windows Server 2003. 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 Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If Else Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit End If 'This tests for a specific username and creates a user account if it does not exist. msgbox "Checking for " & accUserName & " , and creating if not found." QueryForUser(accUserName) 'This reates the new username if it doesn't exist Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("WinNT://" &strComputer) Set colAccounts = GetObject("WinNT://" & strComputer & "") Set objUser = colAccounts.Create("user", accUserName) objUser.SetPassword accUserPass objUser.Put "UserFlags", 65600 objUser.SetInfo 'This adds user to Administrators group msgbox "Creating new user " & accUserName & " , and adding to Administrators group!" Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",user") objGroup.Add(objUser.ADsPath) 'This changes the password if the user exists Sub QueryForUser(accUserName) Set objlocal = GetObject("WinNT://.") objlocal.Filter = Array("user") For Each User In objlocal If lcase(User.Name) = lcase(accUserName) Then strComputer = "." Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ", user") msgbox "User " & accUserName & "exists and adding password." objUser.SetPassword accUserPass objUser.SetInfo 'This checks to see if the user needs added to the Administrators Group Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators") For Each objUser in objGroup.Members If objUser.Name = accUserName Then IsAdmin = "1" End If Next if IsAdmin <> "1" Then msgbox "Adding existing user " & accUserName & " to Administrator group." Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",user") objGroup.Add(objUser.ADsPath) End If End If Next End Sub 'This restarts OS in 10 seconds to apply changes. msgbox "End of script!" 'objWShell.Run "shutdown /r /t 10 /f /d P:4:2" Set objWShell = Nothing I do really appreciate the expert help.
  2. This is all local. There are two sections of this part of the script. Section one: The user Operator does not exist it 1) Creates the Operator account 2) Sets the password 3) Sets the password to never expire 4) Add the user Operator to the Administrators group 5) Jumps over the next section If the user Operator already exists then 1) It sets the password 2) Sets the password to never expire 3) It checks see if the user Operator belongs to the Administrators group, and jumps over if it does With Item 3 above there may be a better way to do it? If the usrer operator already belongs to the Administrators group the script gets an error, so I added a check. There is most likely a better way to do this? The script below works as is. However if it needs to create the Operator user, the registry settings cannot be set for Operator because you can only set those using the HKCU registry. I'm not real sure how to do this. I was thinking to set those in the Administrators group policies. If the Operator account does not exisit then have it do section 1 and then ave a msgbox popup telling the installer that after the reboot they will need to log back using the newly created Operator account, and run the script again. After logging back in using the Operator account the script would check to see if the current user name, password, and group assignment was set correctly, and then bypass that part of the script. The installer would only need to reboot if section one was executed. With section two the user Operator already exists and the script could continue on. 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") getProductName = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") ComputerName = "WinIDS" accUserName = "Operator" accUserPass = "p@ss" 'This tests for x86 processor architecture, and exits if not. Install is not 64bit capable. If getOsType <> "x86" Then Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit ElseIf getVersionNumber <> "5.1" and getVersionNumber <> "5.2" and getVersionNumber <> "6.1" Then Msgbox "The OS Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If QueryForUser(accUserName) 'This creates the new username if it doesn't exist Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("WinNT://" &strComputer) Set colAccounts = GetObject("WinNT://" & strComputer & "") Set objUser = colAccounts.Create("user", accUserName) objUser.SetPassword accUserPass objUser.Put "UserFlags", 65600 ' objUser.SetInfo 'This adds user to Administrators group Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",user") objGroup.Add(objUser.ADsPath) 'This 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 & "/" & accUserName & ", user") objUser.SetPassword accUserPass objUser.SetInfo 'This checks to see if the user needs added to the Administrators Group Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators") For Each objUser in objGroup.Members If objUser.Name = accUserName Then Else Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",user") objGroup.Add(objUser.ADsPath) End If Next End If Next End Sub When the scripts gets to the end the user has to be Operator in order for the registry settings to be set. I didn't incorporate the changes you mentioned so you could see the original script. There are other parts to the script but this part needs to work and the other parts will fall right in. TIA... PS I might mot be able to get right back becuse we are under a hurricane watch and might have no power.
  3. What is happening is that if the user is logged in as user x and and runs the script, it's creating the User Operator, and the script is setting those two registry settings for user x and not Operator. The UAC registry setting is being set because it's HKLM whereas the other two are using HKCU. The solution is to set an Administrators group policy for those two items. Possibly, I was thinking, the script could create the user account and reboot telling the user to log back on with the new Operator credentials and run the script again. I would need to figure out how to bypass the routine that creates the user account, seeing it's already done this. The three things that needs checked ar; Username, Password, and Administrator access. If all three of those are met then it could bypass the routine that creates the user account. This is a really ugly way to do it.
  4. 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") getProductName = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") ComputerName = "WinIDS" If getOsType = "x86" Then Select Case getVersionNumber Case "6.1": Executes this code if it's 6.1, and proceeds to the Continue On... Case "5.2" Or "5.1": Executes this code if it's 5.1 or 5.2, and proceeds to the Continue On... Case Else: Ececutes this code if it's not 6.1, 5.1, or 5.2 End Select Else Executes this code if it's Not x86 End If Continue On... I Was thinking that placing the checks first dumping the user out of the script, which the above is basically doing but inserting the executable code in the middle of the checks. If getOsType <> "x86" Then Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit ElseIf getVersionNumber <> "5.1" and getVersionNumber <> "5.2" and getVersionNumber <> "6.1" Then Msgbox "The OS Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If It just looks like there should be a better way then my example. I have another problem that requires setting policies for the Administrators group. Do you know how to do this from the script? 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"
  5. I'm having a small problem with this sub routine: The getVersionNumber is having a problem. If the getVersionNumber equals either 5.1, 5.2, 0r 6.1 then it's supposed to jump over and continue. However it executes the next line and quits. getOsType = "x86" getVersionNumber = "6.1" If getOsType <> "x86" Then Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit ElseIf getVersionNumber <> "5.1" or getVersionNumber <> "5.2" or getVersionNumber <> "6.1" Then Msgbox "The OS Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If Solved: If getOsType <> "x86" Then Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit ElseIf getVersionNumber <> "5.1" and getVersionNumber <> "5.2" and getVersionNumber <> "6.1" Then Msgbox "The OS Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If Unless there is a better way to do this?
  6. I hacked on the script a little. The first section adds the user to the Administrators group if the user doesn't exist. If the user exists it jumps to the next section, adds a password but doesn't check to see if they belong to the Administrators group, and if they don't it should add them. I'm not reak sure how to add this routine in? Did you find out why it taks so long to run? accUserName = "Operator" accUserPass = "p@ss" QueryForUser(accUserName) 'this section creates the new username if it doesn't exist Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("WinNT://" &strComputer) Set colAccounts = GetObject("WinNT://" & strComputer & "") Set objUser = colAccounts.Create("user", accUserName) objUser.SetPassword accUserPass objUser.Put "UserFlags", 65600 ' objUser.SetInfo 'add user to administrators group Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",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 & "/" & accUserName & ", user") objUser.SetPassword accUserPass objUser.SetInfo msgbox User.Name & " already exists." & vbCrLf & "The password was re-set." WScript.Quit End If Next End Sub TIA..
  7. My script has a problem: First section: Scans the users and adds a user if they don't exist Sets the password, sets the password to not expire, and assigns the user to the Administrators group. Second section: If the user already exists it assigns a new password, and sets the password to not expire. The problem is if the user exists it jumps to the second section. It doesn't check to see if the user belongs to the Administrators group. I can move the code from the first section that adds the user to the Administrators group and it works fine if the user does not already belong to that group. If the user already belongs to the Administrators group it throws an error. What I'm looking for is help putting that routine in section two that checks if the user already belongs to the Administrators group and jumps over that routine. Possibly someone might have a better idea. I have absolutely no training using Visual Basic. I can usually hack something together. accUserName = "Operator" accUserPass = "p@ss" QueryForUser(accUserName) 'this section creates the new username if it doesn't exist Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set objComputer = GetObject("WinNT://" &strComputer) Set colAccounts = GetObject("WinNT://" & strComputer & "") Set objUser = colAccounts.Create("user", accUserName) objUser.SetPassword accUserPass objUser.Put "UserFlags", 65600 ' objUser.SetInfo 'add user to administrators group Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group") Set objUser = GetObject("WinNT://" & strComputer & "/" & accUserName & ",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 & "/" & accUserName & ", user") objUser.SetPassword accUserPass objUser.SetInfo msgbox User.Name & " already exists." & vbCrLf & "The password was re-set." WScript.Quit End If Next End Sub TIA...
  8. Here is the script that I have completed, so far. I still need to add the user name change. Could someone check it out and make any changes that it might need and see if it flows from one task to the other. 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") getProductName = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") ComputerName = "WinIDS" 'Tests for x86 processor architecture and eXits if not. If getOsType = "x86" Then 'Tests for Windows Windows 7 (6.1) and continues if not. If getVersionNumber = "6.1" Then 'Sets registry to disable ELUA, Show Hidden files and folders, and display file extensions. 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" 'Changes the computer name. 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 Set objWMIService = Nothing Set colComputera = Nothing 'Tests for Windows XP (5.1) or Windows Server 2003 (5.2) and eXits script if not. ElseIf getVersionNumber = "5.2" Or "5.1" Then 'Sets registry to Show Hidden files and folders, and display file extensions. 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" 'Changes the computer name. 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 Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If Else Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit End If 'Tests for username and creates or alters user account based on exists or does not exist. 'To be completed 'This finally does a shutdown to apply changes made. objWShell.Run "shutdown /r /t 10 /f /d P:4:2" 'Restarts OS in 10 seconds to apply changes. Set objWShell = Nothing
  9. There is another section of script that goes above this one that is completed. It does all the checking and when it gets to this part of the script it has to be either 6.1, 5.2, or 5.1 The script above works it just needs the sections removed and cleaned up by someone that has theses skills. It wopuld be a lot of trial and error for the inexperianced.
  10. Ok, I started on the next section, and need a little help in getting it cleaned up and changed a little. I'm not at all sure how to edit this correctly, so any help would be great. This section changes the computer name. 1) Can the error checking be removed? 2) Can the "Machine successfully renamed..." be removed? 3) Can the "The OS is not 7, Vista, XP, or 2K3..." be removed? All I need it to do is just bounce through the code with no display. If it's 6.1 then execute that part and continue to the next section of the script to change the user name. If it's not 6.1 then jump to the section for 5.2 or 5.1, and execute with no checking, because at this point it has to be 5.2 or 5.1, and then jump to the section to change the user name. 'This section changes the computer name. ComputerName = "WinIDS" If getVersionNumber = "6.1" 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.2" or "5.1" 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 'This section will add or changes the user name 'To be continued... TIA
  11. This is what I've tested with Windows 7, XP and Server 2003. Processor architecture detection has also been tested. 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") getProductName = objWShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") If getOsType = "x86" Then 'Tests for x86 processor architecture and eXits if not. If getVersionNumber = "6.1" Then 'Tests for Windows Windows 7 install and continues if not. 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.2" Or "5.1" Then 'Tests for Windows XP or Windows Server 2003 and eXits if not. WshShell.Popup "How Do You Feel?", 5, "Good Morning:", 0 + 48 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 Product Name is " & getProductName & ", and is not supported!" & VbCrLf & VbCrLf & "Supported Product Names: XP SP3, Server 2003 SP2, and Windows 7",vbokonly,"Detecting Product Name..." WScript.Quit End If Else Msgbox "The detected processor architecture is: " & getOsType & VbCrLf & VbCrLf & "The WinIDS install only supports 32bit architecture at this time!",vbokonly,"Detecting Processor Architecture..." WScript.Quit End If ' To do: Change Computer name - Complete - XP, Server 2003, and Windows 7 ' Add User Account Plus - XP, Server 2003, and Windows 7 objWShell.Run "shutdown /r /t 10 /f /d P:4:2" 'Restarts OS in 10 seconds to apply changes. Set objWShell = Nothing
  12. Well, it looks like the thread went dead. Does anyone know of a reputable site where I can hire a programmer, or possibly know know of a programmer for Visual Basic that might want to do this?
  13. Yes, 64bit will be supported but the main engine is only 32bit at this time, and a 64bit version is coming but has yet to be started on. If I don't change the computer name before the install, then I have to guide them through setting 'winids' in the hosts file. Disabeling UAC will allow them to use the CMD in Administartor mode, and bypasses a lot of prompts.
  14. The guides are designed for a stand alone system. This will be given away and included in the free software support pack. This will ensure that everyone installing one of the free guides will be on the same page prior to starting the install. There is no kits for sale on my site, and any systems sold are custom built to the customer specifications. Everything can be in a single script. Start the VBS it should allow the user to preform one of the tasks or all the tasks. The menu should have a quit, so if they choose to preform one task it will bounce back to the main menu. This doesn't have to be fancy in any way. I may need to add/remove/edit items to the script in the future so the script needs to be editable. TIA...
  15. I have no idea, but I'm able to test on all.
  16. I've been using this for some time and it works but I'd like to get this converted to a vbs script. I think it might be usefule to a lot of people? The IIS 7 mover file: @echo off setlocal set MOVETO=d:\winids\ echo. echo. echo =============================================================================== echo Starting the move of the IIS7 32bit root directory from %systemdrive%\ to %MOVETO%. echo =============================================================================== echo. echo. REM Stop all IIS services iisreset /stop REM Copy all content REM /O - copy ACLs REM /E - copy sub directories including empty ones REM /I - assume destination is a directory REM /Q - quiet REM echo on, because user will be prompted if content already exists. echo on xcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q @echo off REM Move AppPool isolation directory reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /f REM Move logfile directories %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs\FailedReqLogFiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles" %windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles" REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations %windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history %windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates" %windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files" %windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr %windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerr REM Changes the length of the query string is too long error 404.15 from 2048 to 4096 %windir%\system32\inetsrv\appcmd set config /section:requestFiltering /requestLimits.maxQueryString:4096 REM Make sure Service Pack and Hotfix Installers know where the IIS root directories are reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %mOVETO%\inetpub\wwwroot /f reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%\inetpub\ftproot /f REM Restart all IIS services iisreset /start echo. echo. echo =============================================================================== echo Finished Moving the IIS7 32bit root directory from %systemdrive%\ to %MOVETO%. echo =============================================================================== echo. echo. endlocal The only thing I've been unable to do is have the script remove the original INetPub folder becuse it's a system folder and requires a bit more processing to get it removed. Here is what i've been doing to remove the original Windows 7 INetPub folder after it has been moved to an alternate location: Would it be possible to add this routine to the VBS script as the last process, or add it to the batch file?
  17. Leave me a PM if your interested in doing the job before starting and I'll PM back so as not to get multible people doing the task. Please leave a link to your site or some of your work. The script needs to work completly, on all Window OS's (98 and above) and maybe a comment in the script what the the minimum requirements are in order for the script to work. This needs to be done as a vbs script so as to be able to be added to at a later date, if needed. I have a VMWare OS's installed of 98, 2000, XP (32bit and 64bit), 2003, Windows 7 (32bit & 64bit), and Server 2008 (32bit & 64bit) to test. The task pays a total of $50 dollars to your door using PayPal. TIA...
  18. 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 not supported. 2) Next it needs to check if its 32bit or 64bit architecture. Exits if it’s not 32bit stating unsupported processor architecture: . 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…
  19. Steve21; Ok, also it's not writing the registry values? Testing on Windows 7 Thanks...
  20. 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.
  21. 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...
  22. 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: 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...
  23. 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...
  24. 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.
×
×
  • Create New...