Jump to content

IcemanND

Patron
  • Posts

    3,252
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by IcemanND

  1. That would be the error message I was asking for earlier. Which script is the posted error from and what line is 27?
  2. What you actually have is two scripts mashed together (both of which can actually stand on their own) and then repeated. This can make debugging a bit more difficult. One of the reasons Gunsmokingman provided the script earlier. Script1: strComputer = "pc2" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetCards = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objNetCard in colNetCards arrDNSServers = Array("192.168.1.1", "192.168.1.1") objNetCard.SetDNSServerSearchOrder(arrDNSServers) Next Script2: strComputer = "pc2" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") strIPAddress = Array("192.168.1.101") strSubnetMask = Array("255.255.255.0") strGateway = Array("192.168.1.1") strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Next The first three lines of which do exactly the same thing, the only difference is the variable colNetAdapters and colNetCards, but they contain the same data once the query finishes: strComputer = "pc2" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") The following lines since they are not changing can also be set once and left alone rather than reset for each pass: arrDNSServers = Array("192.168.1.1", "192.168.1.1") <snip> strSubnetMask = Array("255.255.255.0") strGateway = Array("192.168.1.1") strGatewayMetric = Array(1) So if we change colNetadapters to colNetCards and move the static variables to the beginning we can get this and do the same thing: arrDNSServers = Array("192.168.1.1", "192.168.1.1") strSubnetMask = Array("255.255.255.0") strGateway = Array("192.168.1.1") strGatewayMetric = Array(1) StrComputer = "pc2" StrIPAddress = Array("192.168.1.101") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetCards = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objNetCard in colNetCards objNetCard.SetDNSServerSearchOrder(arrDNSServers) errGateways = objNetCard.SetGateways(strGateway, strGatewaymetric) errEnable = objNetCard.EnableStatic(strIPAddress, strSubnetMask) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Next Now since we are reusing the last 2/3 of the script for each machine we could either put it in a loop or make it a function. Gunsmokingman modified it and put it in a loop, I'll do a function. So we first set the variables that don't change. Then set up the computer name variable and it's IP address, then call the function, Repeat these three lines as needed for each machine. strComputer = "pc1" strIPAddress = Array("192.168.1.100") ChangeNetCard The only additional thing I have added is to destroy the variables used for the WMI query at the end of the function, while not required I have seen occasional issues when they are not destroyed and you are running scripts against multiple computers: arrDNSServers = Array("192.168.1.1", "192.168.1.1") strSubnetMask = Array("255.255.255.0") strGateway = Array("192.168.1.1") strGatewayMetric = Array(1) strComputer = "pc1" strIPAddress = Array("192.168.1.100") ChangeNetCard strComputer = "pc2" strIPAddress = Array("192.168.1.101") ChangeNetCard Function ChangeNetCard Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetCards = objWMIService.ExecQuery _ ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True") For Each objNetCard in colNetCards objNetCard.SetDNSServerSearchOrder(arrDNSServers) errGateways = objNetCard.SetGateways(strGateway, strGatewaymetric) errEnable = objNetCard.EnableStatic(strIPAddress, strSubnetMask) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Next set objWMIService = Nothing Set colNetcards = Nothing end Function See if you can get any further with this.
  3. Didn't even think about DSFOK. Was thinking imaging tools but couldn't come up with any I knew would image UFD's. I'll give it a try and see how well it will work.
  4. I have a project that I need to create 40ish identical bootable usb thumb drives. Looks like we are going to get 16gb Sandisk Micro Cruzers, so I'll have to whack the U3 software from them all too, then duplicate. Anyone know of some good software for duplicating Usb Flash Devices?
  5. Are both PC1 and PC2 remote machines? Your not running and testing the script from PC1. If you run just the second half for PC2 and don't do PC1 does it work?
  6. pc1 will change...but pc2 will not change But does it give an error somewhere when it reaches that half of the script?
  7. Try it Ponch's way with a real XP cd. No further discussion of warez'd software will be tolerated. CLOSED
  8. Only problem with that is if C was the hard drive you wanted to image because it wasn't blank and got a letter, it will now be S and get cleaned but you won't know your USB devices letter. May not be an issue depends upon how or if you use your USB device during your imaging/deployment process.
  9. Use diskpart to re-letter your USB drive. The boot path of the usb drive (or the letter it was assigned, can be found in the registry at: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\PEBootRamdiskSourceDrive
  10. Robocopy with a job file should work for you.
  11. My wife has that one and doesn't like the open pocket, but other than that it's a good one too.
  12. I've been known to carry two laptops in mine, 15" and 17" dells. And it still has room for more.
  13. Replace your 'goto END' to 'goto LOOP' where you want to return to your menu. If this menu is running from the Startnet.cmd, add an EXIT command as the last line in startnet.cmd to cause the reboot.
  14. I've got a backpack, this one http://www.wengerna.com/synergy-ga-7305-14 as a matter of fact. Like it much better than the previous two backpacks/messenger bags I've had.
  15. Post your code, that may help us see what you need to do.
  16. Have you tried it without the quotes? Also would not think that you would need the paths as the shell is launched from system32 and is the default path. %SYSTEMDRIVE%\Windows\System32\diskpart.exe, /s %SYSTEMDRIVE%\Windows\System32\diskpart.txt
  17. I have not read that there were any changes to NTFS in Windows 7 from Vista as far as volume sizes go. Here are the upper RAM limits for the different editions of Windows 7: * Starter: 8GB * Home Basic: 8GB * Home Premium: 16GB * Professional: 192GB * Enterprise: 192GB * Ultimate: 192GB I can't find proof of it but I would expect that it will support 1-2 processor sockets depending upon version like Vista does. Vista Home Basic and Home Premium support one socketed processor, Business and Ultimate support two. Doesn't matter how many cores in those processors, though there is likely a limit doubt we will reach it anytime soon.
  18. We had/have a homegrown system in place, that is now only use by a small portion of our group (15%). The rest have all switched and use SMS. So we also have all the other features of SMS to go along with it. So far the only complaints have been the delay between when the machine was built and the client installed to when it starts to get it's assigned apps or does the inventory if you don't force it.
  19. Are you using the latest HD controller drivers?
  20. Or it doesn't like the drivers for your HD controller.
  21. Does he have the Windows Image Acquisition servide disabled or stopped? The phot printing wizard seems to want this in my experience. Also what model printer is it?
  22. 1. no file size summary in the "details pane." Only shows how many items. Now I have to select all files and choose properties and then i can see what size they use. Works for me as long as I don't select a folder, which is the same way vista was. 2. can't "breadcrumb" up to the desktop if you mean the ".." folders, sorry can't help there. Use the favorites listing desktop is right there. 3. few windows are actually affected when changing window color 4. must go to Advanced - Monitor to change screen refresh rate. Same as Vista, and XP 5. can no longer close windows by right clicking their tab in task bar and pressing "c" on the keyboard. Shift right click then C 6. long filenames are truncated and hidden. Where? 7. Difficult to select files, not much space between file icons Again where? What view are you using? 8. main window shadow too dark, hides too much of the windows behind 9. The new super bar requires two clicks and identification of a thumbnail. I find this much slower then the classic with an icon and name. This I agree is a pain to get used to 10. Sort by tabs like size and name should be present in all view modes. Well you don't have size in all view modes. And it sorts by the data displayed, yes they could sort by other data but then users would get confused when a folder was sorted Z, A, Q, B for no apparent reason.
  23. You have to log in with a Windows Live ID, then it gives you your key.
×
×
  • Create New...