+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
Scripts Thread, Need help in sorting these scripts out and possible better solutions. in Coding and Web Development; Leave me a PM if your interested in doing the job before starting and I'll PM back so as not ...
  1. #16

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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...

  2. #17

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,125
    Thank Post
    1,433
    Thanked 1,699 Times in 1,272 Posts
    Blog Entries
    2
    Rep Power
    365
    If you want to look at @ZeroHour and his work, have a look at EduGeek.net - The I.T. Professionals' life line that should satisfy your needs - He has also helped me code up the EduGod Mode application

  3. #18

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by ZeroHour View Post
    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
    Thanks...

  4. #19

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,228
    Thank Post
    2,773
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    I presume the chunks of code you posted originally all work on the different O/S'es you have mentioned ( xp, 7 and 2003 ) ?

  5. #20

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I have no idea, but I'm able to test on all.

  6. #21

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Location
    Edinburgh, Scotland
    Posts
    5,579
    Thank Post
    870
    Thanked 1,294 Times in 787 Posts
    Blog Entries
    1
    Rep Power
    437
    Right a few questions to see what the best solution is.
    1. Do you have the option to use group policy (aka on a domain)?
    2. Is this for building new hardware yourselves or you pass the scripts to others that have purchased the kit?
    3. Does it have to be multiple scripts?
    4. Does it have to be a script or can AutoIT for example do some of the work? (it has some very useful stuff for this and easy to code)
    Answer these and we should be able to look for a way forward.

  7. #22

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by ZeroHour View Post
    Right a few questions to see what the best solution is.
    1. Do you have the option to use group policy (aka on a domain)?
    2. Is this for building new hardware yourselves or you pass the scripts to others that have purchased the kit?
    3. Does it have to be multiple scripts?
    4. Does it have to be a script or can AutoIT for example do some of the work? (it has some very useful stuff for this and easy to code)
    Answer these and we should be able to look for a way forward.
    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...

  8. #23


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,134
    Thank Post
    204
    Thanked 2,395 Times in 1,773 Posts
    Rep Power
    705
    A few questions...
    1. Do you intend on supporting 64-bit OSs in the near future?
    2. Why does the computer name have to be changed? Seems a bizarre requirement (unless this is optional).
    3. Does the script have to disable UAC? Is there any particular reason why it can't be kept on?

  9. #24

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by Arthur View Post
    A few questions...
    1. Do you intend on supporting 64-bit OSs in the near future?
    2. Why does the computer name have to be changed? Seems a bizarre requirement (unless this is optional).
    3. Does the script have to disable UAC? Is there any particular reason why it can't be kept on?
    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.

  10. #25

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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?

  11. #26

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    11,125
    Thank Post
    1,433
    Thanked 1,699 Times in 1,272 Posts
    Blog Entries
    2
    Rep Power
    365
    You cant expect it to be done in an instant, we do have lives you know!

  12. #27

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This is what I've tested with Windows 7, XP and Server 2003. Processor architecture detection has also been 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")
    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

  13. #28

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

    Code:
    '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
    Last edited by mesteele101; 22nd August 2011 at 04:40 AM.

  14. #29

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,228
    Thank Post
    2,773
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    Not sure if this will help with part of the script but if you use the select case method , it may make it easier and neater to read ie

    Select Case getVersionNumber

    Case 5.1:
    'Code here to execute if it is 5.1

    Case 5.2:

    'Code here to execute if it is 5.2

    Case 6.1:

    'code here to execute if it is 6.1

    End Select

    I think you can use OR or AND if you want to make it so that if it is 5.1 or 5.2 then it executes the same chunk of code ie

    Select Case getVersionNumber

    Case 5.1 OR 5.2:

    'code here to execute if it is either 5.1 or 5.2

    Case 6.1:

    'code here to execute if 6.1

    End Select

    When combing or checking multiple values I can't remember if you need to enclose each value in quotes ie

    "5.1" OR "5.2"

    You are also better off having the error checking so personally I would keep it in there where possible, I presume you are reffering to the

    If err <> 0 Then
    Else
    Computer was renamed succesfully
    End If


    With regards to the error message about this is not windows 7, xp or 2003 can be removed but then how are you advising your user that the code will not execute or run because it is not the correct OS ?

    The same with the computer has been renamed or not , you can remove the msgbox alerts but then the user has no way of knowing if it was done or not
    Last edited by mac_shinobi; 22nd August 2011 at 08:59 AM.

  15. #30

    Join Date
    Jul 2011
    Location
    USA
    Posts
    27
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 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
  •