Jump to content

cluberti

Patron
  • Posts

    11,045
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    country-ZZ

Everything posted by cluberti

  1. Not only that the PTE size for each allocation would run you out of paged pool memory long before you ever got to any kind of serious uptime on servers that would deal with those files. Unless it's an x64 server (and you have a darned good reason to have such large block sizes), 4 or 8K sizes are much more preferable. And again, I wouldn't even consider it on a 32bit server due to paged pool constraints if you end up with large numbers of files open over a period of time either.
  2. Yeah, no. Especially the part about downloading XP from the 'net. I've told you the two options you have, and those are it. I would suggest you read the rules again, especially that first one, rule 1.a. Warning #1 and only - again and banned. [Closed].
  3. This wouldn't happen to be related to your homework, would it?
  4. So he'd be willing to buy Vista, but not Win7? I'd call that crazy talk . Unless there's some specific reason you need XP x64 (or if you've already got a legal retail install disc and key and aren't buying a new OS), going with it over Win7 x64 seems a little odd.
  5. Looks like we have kernel paged pool corruption - either a bum driver, or failure under load: // The actual bugcheck thread: 0: kd> kb ChildEBP RetAddr Args to Child bc8bd22c 89828fff 00000024 001904aa bc8bd758 nt!KeBugCheckEx+0x1e bc8bd254 8989a23a bc8bdc28 bc8bd288 8981fbc8 Ntfs!NtfsExceptionFilter+0xad (FPO: [2,0,4]) bc8bd260 8981fbc8 00000000 bc8bdb80 89848528 Ntfs!NtfsCheckpointAllVolumesWorker+0x6d (FPO: [SEH]) bc8bd274 89827e65 00000000 00000000 00000000 Ntfs!_EH4_CallFilterFunc+0x12 (FPO: [Uses EBP] [0,0,4]) bc8bd29c 81ce2462 fffffffe bc8bdb70 bc8bd454 Ntfs!_except_handler4+0x8e (FPO: [4,5,4]) bc8bd2c0 81ce2434 bc8bd758 bc8bdb70 bc8bd454 nt!ExecuteHandler2+0x26 bc8bd378 81c608df bc8bd758 bc8bd454 7c0dd498 nt!ExecuteHandler+0x24 bc8bd73c 81c8483a bc8bd758 00000000 bc8bd7ac nt!KiDispatchException+0x170 bc8bd7a4 81c847ee bc8bd824 898afb24 badb0d00 nt!CommonDispatchException+0x4a (FPO: [0,20,0]) bc8bd824 898aff5c 8a1f6048 bc8bd844 bc8bd85c nt!Kei386EoiHelper+0x186 bc8bd854 898afc68 00000000 8bc654b0 00000070 Ntfs!LfsVerifyLogSpaceAvail+0x1c (FPO: [5,4,4]) bc8bd898 898923bc 8a1f6048 8bc654b0 00000000 Ntfs!LfsWriteLogRecordIntoLogPage+0x5a (FPO: [13,7,4]) bc8bd908 8989953e 8bc654b0 00000070 bc8bd96c Ntfs!LfsWriteRestartArea+0xe5 (FPO: [SEH]) bc8bdb2c 8989a203 bc8bdc28 86d860d8 00000000 Ntfs!NtfsCheckpointVolume+0x132c (FPO: [SEH]) bc8bdb80 89899f34 bc8bdc28 86d860d8 bc8bdd43 Ntfs!NtfsCheckpointAllVolumesWorker+0x3b (FPO: [SEH]) bc8bdbe0 8989a10e bc8bdc28 00000000 8989a1c4 Ntfs!NtfsForEachVcb+0xe6 (FPO: [SEH]) bc8bdd44 81cdee22 00000000 00000000 877a4c68 Ntfs!NtfsCheckpointAllVolumes+0xab (FPO: [1,79,4]) bc8bdd7c 81e0ec42 00000000 7c0dde64 00000000 nt!ExpWorkerThread+0xfd bc8bddc0 81c77efe 81cded25 80000000 00000000 nt!PspSystemThreadStartup+0x9d 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16 // The thread that actually crashed in the LfsVerifyLogSpaceAvail helper callout: 0: kd> kb ChildEBP RetAddr Args to Child bc8bd824 898aff5c 8a1f6048 bc8bd844 bc8bd85c Ntfs!LfsCurrentAvailSpace+0x32 bc8bd854 898afc68 00000000 8bc654b0 00000070 Ntfs!LfsVerifyLogSpaceAvail+0x1c bc8bd898 898923bc 8a1f6048 8bc654b0 00000000 Ntfs!LfsWriteLogRecordIntoLogPage+0x5a bc8bd908 8989953e 8bc654b0 00000070 bc8bd96c Ntfs!LfsWriteRestartArea+0xe5 bc8bdb2c 8989a203 bc8bdc28 86d860d8 00000000 Ntfs!NtfsCheckpointVolume+0x132c bc8bdb80 89899f34 bc8bdc28 86d860d8 bc8bdd43 Ntfs!NtfsCheckpointAllVolumesWorker+0x3b bc8bdbe0 8989a10e bc8bdc28 00000000 8989a1c4 Ntfs!NtfsForEachVcb+0xe6 bc8bdd44 81cdee22 00000000 00000000 877a4c68 Ntfs!NtfsCheckpointAllVolumes+0xab bc8bdd7c 81e0ec42 00000000 7c0dde64 00000000 nt!ExpWorkerThread+0xfd bc8bddc0 81c77efe 81cded25 80000000 00000000 nt!PspSystemThreadStartup+0x9d 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16 // Looking at kernel paged pool consumption, it's actually not that high at all: 0: kd> !vm ... PagedPool Usage: 61788 ( 247152 Kb) PagedPool Maximum: 523264 ( 2093056 Kb) ... // About 50% of used kernel pool is by Symantec (they use the SaEe tag for the Endpoint Protection product, along with SavE): 0: kd> !poolused 4 Sorting by Paged Pool Consumed Pool Used: NonPaged Paged Tag Allocs Used Allocs Used SaEe 0 0 699 103839768 UNKNOWN pooltag 'SaEe', please update pooltag.txt MmSt 0 0 13007 36904176 Mm section object prototype ptes , Binary: nt!mm .... So looking at the raw stack to see if anything came in after the LfsCheckpoint caller, but before the return was made...: 0: kd> dds bc8bd22c bc8bd22c bc8bd254 bc8bd230 89828fff Ntfs!NtfsExceptionFilter+0xad bc8bd234 00000024 bc8bd238 001904aa bc8bd23c bc8bd758 bc8bd240 bc8bd454 bc8bd244 898afb24 Ntfs!LfsCurrentAvailSpace+0x32 bc8bd248 00000000 bc8bd24c 00000000 bc8bd250 00000000 bc8bd254 bc8bdb80 bc8bd258 8989a23a Ntfs!NtfsCheckpointAllVolumesWorker+0x6d bc8bd25c bc8bdc28 bc8bd260 bc8bd288 bc8bd264 8981fbc8 Ntfs!_EH4_CallFilterFunc+0x12 bc8bd268 00000000 bc8bd26c bc8bdb80 bc8bd270 89848528 Ntfs!__safe_se_handler_table+0x5248 bc8bd274 bc8bd29c bc8bd278 89827e65 Ntfs!_except_handler4+0x8e bc8bd27c 00000000 bc8bd280 00000000 bc8bd284 00000000 bc8bd288 bc8bd758 bc8bd28c bc8bd454 bc8bd290 89848538 Ntfs!__safe_se_handler_table+0x5258 bc8bd294 00000001 bc8bd298 0084c8b0 bc8bd29c bc8bd2c0 bc8bd2a0 81ce2462 nt!ExecuteHandler2+0x26 bc8bd2a4 fffffffe bc8bd2a8 bc8bdb70 ... bc8bd504 bc8bd844 bc8bd508 bc8bd824 bc8bd50c 898afb24 Ntfs!LfsCurrentAvailSpace+0x32 bc8bd510 00000008 bc8bd514 00010293 ... // And there it is - Nvidia networking drivers hooked and modified the call: bc8bd590 bc8bd58c bc8bd594 00000000 bc8bd598 00000000 bc8bd59c 00000000 bc8bd5a0 bc8bd7c8 bc8bd5a4 bc8bd604 bc8bd5a8 8e71b289 nvm60x32!ADAPTER_GetStatistics+0x209 bc8bd5ac 8e770d40 nvm60x32!gAdapterContexts+0x16e8 bc8bd5b0 bc8bd7cc bc8bd5b4 877a6d24 bc8bd5b8 bc8bda44 bc8bd5bc 877a7008 bc8bd5c0 00000000 bc8bd5c4 00000000 bc8bd5c8 00000000 bc8bd5cc 00000000 bc8bd5d0 00000000 bc8bd5d4 00000000 bc8bd5d8 00000000 bc8bd5dc 00000000 bc8bd5e0 00000001 bc8bd5e4 00000000 bc8bd5e8 ac65be40 bc8bd5ec bc8bd618 bc8bd5f0 81cebaf5 nt!IoWithinStackLimits+0x56 bc8bd5f4 877a4c68 bc8bd5f8 00000000 bc8bd5fc 86d86020 bc8bd600 bc8bdc08 bc8bd604 bc8bd790 bc8bd608 8e717d4d nvm60x32!HMacdDefaultFunc+0x733 bc8bd60c 8e770d40 nvm60x32!gAdapterContexts+0x16e8 ... bc8bd614 00000098 bc8bd618 84d317e8 bc8bd61c 8e71848e nvm60x32!HMacdDefaultFunc+0xe74 bc8bd620 bc8bdc08 bc8bd624 00000020 bc8bd628 00000000 bc8bd62c 01010004 bc8bd630 bc8bd6ac bc8bd634 8982344a Ntfs!NtfsFsdWrite+0x25 bc8bd638 bc8bd6ac bc8bd63c 8981f9ea Ntfs!_SEH_epilog4_GS+0xa bc8bd640 8982379b Ntfs!NtfsFsdWrite+0x36c bc8bd644 350f0d66 bc8bd648 00000000 bc8bd64c 86d86020 bc8bd650 ac65bde0 bc8bd654 bc8bd6c0 bc8bd658 8220688b fltmgr!FltpPerformPreCallbacks+0x367 bc8bd65c ac65bde0 bc8bd660 86d6f69c bc8bd664 00000598 bc8bd668 bc8bd6f4 bc8bd66c bc8bd690 bc8bd670 898b00e9 Ntfs!LfsTransferLogBytes+0x6b bc8bd674 ccabc260 bc8bd678 ac9b0750 bc8bd67c 00000598 bc8bd680 8bc985c0 bc8bd684 a1b21d78 bc8bd688 00000260 ... bc8bd688 00000260 bc8bd68c ac9b0750 bc8bd690 bc8bd6dc bc8bd694 898afe2d Ntfs!LfsWriteLogRecordIntoLogPage+0x21f bc8bd698 a1b21d78 bc8bd69c bc8bd6d4 bc8bd6a0 00000000 bc8bd6a4 86d859e0 bc8bd6a8 86d859c8 bc8bd6ac 00000000 bc8bd6b0 bc8bd6d8 bc8bd6b4 86d859c8 bc8bd6b8 00000000 bc8bd6bc 86d85900 bc8bd6c0 bc8bd6d0 bc8bd6c4 81c0d70c hal!KfLowerIrql+0x64 bc8bd6c8 00000000 bc8bd6cc 86d85900 bc8bd6d0 bc8bd6f0 bc8bd6d4 81c0a0ed hal!KeReleaseQueuedSpinLock+0x2d bc8bd6d8 81ce47c5 nt!ExpReleaseResourceForThreadLite+0x14a bc8bd6dc 8bc60000 bc8bd6e0 00000000 bc8bd6e4 00000000 bc8bd6e8 86d859fc bc8bd6ec 00000800 bc8bd6f0 bc8bd708 bc8bd6f4 81ce4673 nt!ExReleaseResourceLite+0xf bc8bd6f8 00000002 bc8bd6fc bc8bd710 bc8bd700 81cec06a nt!MiLocateAddress+0x41 bc8bd704 bc8bd70c // Looking at the drivers you're using, they're from October 2006, which is actually before Vista went RTM (Vista went RTM in November 2006, and wasn't GA until January 2007): 0: kd> lmvm nvm60x32 start end module name 8e708000 8e7ca000 nvm60x32 (pdb symbols) d:\symbols\nvm60x32.pdb\82EBF586382C42C8B88EBD538670055E1\nvm60x32.pdb Loaded symbol image file: nvm60x32.sys Image path: \SystemRoot\system32\DRIVERS\nvm60x32.sys Image name: nvm60x32.sys Timestamp: Sat Oct 07 00:30:59 2006 (45272D83) CheckSum: 0006CB50 ImageSize: 000C2000 Translations: 0000.04b0 0000.04e4 0409.04b0 0409.04e4 Given the date, these are prior to the WHQL 15.00 release (which was the first officially supported driver set for Vista) - and from the October 2006 date, I'd say it's the nForce 11.06 driver set for 2000 and XP. I would STRONGLY suggest upgrading these nforce drivers (and for good measure, Symantec Endpoint Protection) to the latest Vista certified releases to alleviate the issue.
  6. If you cannot even open up a cmd prompt from task manager (or open task manager itself), consider booting into safe mode and see if things work there. Otherwise, yes, an XP repair is probably the only other reasonable option you have short of a complete reformat and reinstall.
  7. Get a crash dump of explorer.exe using adplus, then ZIP and upload the resulting 2nd chance .dmp file somewhere we can access.
  8. They're getting prompted because the current user account that they've used to log into their remote XP system doesn't match a user and password combination on your PC. So, either you create one that they can use (and make sure it has access), or you enable the guest account and give that account permissions to the shares on your XP machine. The former is more secure, obviously.
  9. What language, and what do you have so far?
  10. The ReturnOSVersion function should contain: Case $VER = "WIN_7" $OS = "Windows 7" Case $VER = "WIN_VISTA" $OS = "Windows Vista" Case $VER = "WIN_XP" $OS = "Windows XP" Case $VER = "WIN_2000" $OS = "Windows 2000" Case $VER = "WIN_98" $OS = "Windows 98" Case $VER = "WIN_ME" $OS = "Windows ME" Case $VER = "WIN_95" $OS = "Windows 95" Case $VER = "WIN_NT4" $OS = "Windows NT4" What you do with the new responses in that source is your own design. Note you can get the version simply by returning the @OSVersion macro: MsgBox (0, "OS Version", @OSVersion) For example:
  11. cluberti

    MDT 2010

    MDT2010 uses the "Format and Partition Disk" step in the "New Computer Only" section of the "Preinstall" phase to determine what/how to format and partitioin the disk. You could try disabling or deleting that step, but I've not checked to see what will happen.
  12. Unless he uses an app that ingests the affected areas, no, probably not. However, if you've still got the app installed, there's no reason NOT to update it to the latest cumulative update either, given that there could be any number of unknown vulnerabilities with any product on the system, so if you're going to have it installed (and with IE, until Win7 you have no real choice), you probably should update it regularly. Given that the shell itself uses IE components in day-to-day usage, not updating it seems unsafe to me.
  13. Well, to be fair, if we're going to point out 50% of the flaws, let's show what they are: Secunia Advisory 38209, extremely critical, reported 1/15/2010 (3 days ago). Use after free error on a malicious page, would allow execution of code at user privilege level. Somewhat mitigated with Protected Mode/UAC on Vista and Win7, as a low integrity process would only have access to low integrity file and registry locations, which is basically nowhere except the user's temp directory - anything else would trigger a UAC prompt. Affects 6, 7, and 8 Secunia Advisory 37362, not critical, reported 11/25/2009. This requires a PDF file and printer, and the vulnerability exists in the first 63 bytes of the PDF file sent to the printer, which is more a vulnerability of the PDF document containing the data than an IE issue - hence "not critical". Affects 6, 7, and 8 Secunia Advisory 36334, not critical, reported 8/19/2009. Requires IE6 or 7 to be truly spoofed, as IE8 highlights the domain portion of the URL to show the spoofed address. Also requires that you trust the site in question (trusted sites or local intranet zone), and wouldn't happen in the internet zone where most pages would display (hence "not critical"). Affects 6, 7, and 8. Secunia Advisory 24314, less critical, reported 5/12/2009 for IE8. Requires that an iFrame be hosted as a UTF-7 document in a parent UTF-8 charset page, and that the page be malicious in nature (can execute arbitrary HTML and jscript/vbscript in a user's session). Due to the increased security in IE7 and IE8 on Vista and Win7, this vulnerability only affects XP systems (where there is no integrity level separation of processes). Affects 7 and 8 on XP only. Also, if you look closely at the rest of the vulnerabilities affecting even IE6 or IE7, you'll find they're mostly social engineering exploits. Given that IE isn't just a browser, it's also an application platform, I'm not sure Microsoft could do much more to fix these sorts of things without removing the "application platform" functionality of the browser, and given that it's one of the main selling points for businesses I highly doubt that'll happen until most of the web moves to web-based apps (entirely) and server-side functionality with no client plugins required.
  14. See post #5 - in essence, yes.
  15. It's actually not IE tied to Windows, it's the other way around, but yeah - it raises the attack surface. They're finally getting away from it with IE8 and Win7, but that doesn't help folks using older OSes for sure.
  16. I've moved this to the unattended Win7 section - there are some complete XML samples in here, so have a look.
  17. It doesn't look like it's being called directly, so I would start by disabling the startup of everything non-Microsoft, and start re-enabling things a few at a time (rebooting after each change) and use trial and error to see which entry in your startup or services list is causing it.
  18. You have to remember that included files are processed and inserted before the scripts are executed, meaning that won't work. That KB gives a good workaround, though.
  19. Part of the reason I don't have global error handling in the script is to catch problems like this with it - if On Error Resume Next was set globally, you'd have errors but the script would continue and you wouldn't necessarily notice. Anything that's caught, simply on error the segment, check .Err, and do your error handling - just like you did .
  20. Edit - wow, I've managed to create a post larger than the size tag will apply to! Anyway, I've deleted my previous post and posted an update that should fix that by catching it: '// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// NAME: osinfo.vbs '// '// Original: http://www.cluberti.com/blog '// Last Update: 9th January 2010 05:34 GMT '// '// Comment: VBS example file for use as an OS info gathering template. '// '// NOTE: Provided as-is - usage of this source assumes that you are at the '// very least familiar with the vbscript language being used and '// the tools used to create and debug this file. '// '// In other words, if you break it, you get to keep the pieces. '// '// Also, if you want to use this on W2K, prepare to hack, as this '// was really designed with XP+ systems in mind. '// '// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// This script will require elevated privileges if run from a non-admin account, so '// calling the ElevateThisScript() Sub should get the script a full admin token. This is '// currently disabled, but if you need non-admin users to run this script, enable the '// call to this subroutine to pop-up a dialog box (they'll of course need administrative '// credentials to put in the challenge dialog before the script will execute with an '// administrative token): Dim ScriptHelper Set ScriptHelper = New ScriptHelperClass ScriptHelper.RunMeWithCScript() 'ScriptHelper.ElevateThisScript() '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables and wMI connections for scripting against: strComputer = ScriptHelper.Network.ComputerName CONST HKEY_CLASSES_ROOT = &H80000000 CONST HKEY_CURRENT_USER = &H80000001 CONST HKEY_LOCAL_MACHINE = &H80000002 CONST HKEY_USERS = &H80000003 CONST KEY_QUERY_VALUE = 1 CONST KEY_SET_VALUE = 2 CONST SEARCH_KEY = "DigitalProductID" Dim arrSubKeys(4,1) Dim foundKeys Dim iValues, arrDPID foundKeys = Array() iValues = Array() arrSubKeys(0,0) = "Windows PID Key: " arrSubKeys(0,1) = "SOFTWARE\Microsoft\Windows NT\CurrentVersion" arrSubKeys(2,0) = "Office XP PID Key: " arrSubKeys(2,1) = "SOFTWARE\Microsoft\Office\10.0\Registration" arrSubKeys(1,0) = "Office 2003 PID Key: " arrSubKeys(1,1) = "SOFTWARE\Microsoft\Office\11.0\Registration" arrSubKeys(3,0) = "Office 2007 PID Key: " arrSubKeys(3,1) = "SOFTWARE\Microsoft\Office\12.0\Registration" arrSubKeys(4,0) = "Office 2010 PID Key: " Arch = "" Sku = "" Set colOSItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_OperatingSystem",,48) Set colProcItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_Processor",,48) Set colCompSysItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_ComputerSystem",,48) Set colTZItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_TimeZone",,48) Set colCompSysProdItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_ComputerSystemProduct",,48) Set colBIOSItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_BIOS",,48) Set colDiskItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_LogicalDisk",,48) Set colNetAdapConfigItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_NetworkAdapterConfiguration",,48) Set colVideoItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_VideoController",,48) Set colSoundItems = ScriptHelper.WMI.ExecQuery( _ "SELECT * FROM Win32_SoundDevice",,48) '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// If Office 2010 is installed, find the Office 2010 registry key holding the ProductID: Dim strKey, subkey, arrSubkeys2, strOfficeKey, strValue strKey = "SOFTWARE\Microsoft\Office\14.0\Registration" ScriptHelper.Registry.EnumKey HKEY_LOCAL_MACHINE, strKey, arrSubkeys2 If IsNull(arrSubkeys2) Then 'Office 2010 not installed, skip it arrSubKeys(4,1) = "" Else For Each subkey In arrSubkeys2 ScriptHelper.Registry.GetBinaryValue HKEY_LOCAL_MACHINE, strKey & "\" & subkey, SEARCH_KEY, strValue If IsNull(strValue) Then strOfficeKey = "" Else strOfficeKey = strKey & "\" & subkey arrSubKeys(4,1) = strOfficeKey End If Next End If '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Get OS SKU from Win32_OperatingSystem class: For Each objOSItem in colOSItems If objOSItem.BuildNumber => 6000 Then Arch = objOSItem.OSArchitecture Select Case objOSItem.OperatingSystemSKU Case 0 Sku = "Unknown Windows version" Case 1 Sku = "Ultimate Edition" Case 2 Sku = "Home Basic Edition" Case 3 Sku = "Home Premium Edition" Case 4 Sku = "Enterprise Edition" Case 5 Sku = "Home Basic N Edition" Case 6 Sku = "Business Edition" Case 7 Sku = "Standard Server Edition" Case 8 Sku = "Datacenter Server Edition" Case 9 Sku = "Small Business Server Edition" Case 10 Sku = "Enterprise Server Edition" Case 11 Sku = "Starter Edition" Case 12 Sku = "Datacenter Server Core Edition" Case 13 Sku = "Standard Server Core Edition" Case 14 Sku = "Enterprise Server Core Edition" Case 15 Sku = "Enterprise Server Edition for Itanium-Based Systems" Case 16 Sku = "Business N Edition" Case 17 Sku = "Web Server Edition" Case 18 Sku = "Cluster Server Edition" Case 19 Sku = "Home Server Edition" Case 20 Sku = "Storage Express Server Edition" Case 21 Sku = "Storage Standard Server Edition" Case 22 Sku = "Storage Workgroup Server Edition" Case 23 Sku = "Storage Enterprise Server Edition" Case 24 Sku = "Server For Small Business Edition" Case 25 Sku = "Small Business Server Premium Edition" Case Else Sku = "Could Not Determine Operating System SKU" End Select End If '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Get current OS locale setting from Win32_OperatingSystem class: Select Case objOSItem.Locale Case 0436 Locale = "Afrikaans (South Africa)" Case 041c Locale = "Albanian (Albania)" ' Case 045e Locale = "Amharic (Ethiopia)" Case 0401 Locale = "Arabic (Saudi Arabia)" Case 1401 Locale = "Arabic (Algeria)" Case 3c01 Locale = "Arabic (Bahrain)" Case 0c01 Locale = "Arabic (Egypt)" Case 0801 Locale = "Arabic (Iraq)" Case 2c01 Locale = "Arabic (Jordan)" Case 3401 Locale = "Arabic (Kuwait)" Case 3001 Locale = "Arabic (Lebanon)" Case 1001 Locale = "Arabic (Libya)" Case 1801 Locale = "Arabic (Morocco)" Case 2001 Locale = "Arabic (Oman)" Case 4001 Locale = "Arabic (Qatar)" Case 2801 Locale = "Arabic (Syria)" Case 1c01 Locale = "Arabic (Tunisia)" Case 3801 Locale = "Arabic (U.A.E.)" Case 2401 Locale = "Arabic (Yemen)" Case 042b Locale = "Armenian (Armenia)" Case 044d Locale = "Assamese" Case 082c Locale = "Azeri (Cyrillic)" Case 042c Locale = "Azeri (Latin)" Case 042d Locale = "Basque" Case 0423 Locale = "Belarusian" Case 0445 Locale = "Bengali (India)" Case 0845 Locale = "Bengali (Bangladesh)" Case 141A Locale = "Bosnian (Bosnia/Herzegovina)" Case 0402 Locale = "Bulgarian" Case 0455 Locale = "Burmese" Case 0403 Locale = "Catalan" Case 045c Locale = "Cherokee (United States)" Case 0804 Locale = "Chinese (PRC)" Case 1004 Locale = "Chinese (Singapore)" Case 0404 Locale = "Chinese (Taiwan)" Case 0c04 Locale = "Chinese (Hong Kong SAR)" Case 1404 Locale = "Chinese (Macao SAR)" Case 041a Locale = "Croatian" Case 101a Locale = "Croatian (Bosnia/Herzegovina)" Case 0405 Locale = "Czech" Case 0406 Locale = "Danish" Case 0465 Locale = "Divehi" Case 0413 Locale = "Dutch (Netherlands)" Case 0813 Locale = "Dutch (Belgium)" Case 0466 Locale = "Edo" Case 0409 Locale = "English (United States)" Case 0809 Locale = "English (United Kingdom)" Case 0c09 Locale = "English (Australia)" Case 2809 Locale = "English (Belize)" Case 1009 Locale = "English (Canada)" Case 2409 Locale = "English (Caribbean)" Case 3c09 Locale = "English (Hong Kong SAR)" Case 4009 Locale = "English (India)" Case 3809 Locale = "English (Indonesia)" Case 1809 Locale = "English (Ireland)" Case 2009 Locale = "English (Jamaica)" Case 4409 Locale = "English (Malaysia)" Case 1409 Locale = "English (New Zealand)" Case 3409 Locale = "English (Philippines)" Case 4809 Locale = "English (Singapore)" Case 1c09 Locale = "English (South Africa)" Case 2c09 Locale = "English (Trinidad)" Case 3009 Locale = "English (Zimbabwe)" Case 0425 Locale = "Estonian" Case 0438 Locale = "Faroese" Case 0429 Locale = "Farsi" Case 0464 Locale = "Filipino" Case 040b Locale = "Finnish" Case 040c Locale = "French (France)" Case 080c Locale = "French (Belgium)" Case 2c0c Locale = "French (Cameroon)" Case 0c0c Locale = "French (Canada)" Case 240c Locale = "French (DRC)" Case 300c Locale = "French (Cote d'Ivoire)" Case 3c0c Locale = "French (Haiti)" Case 140c Locale = "French (Luxembourg)" Case 340c Locale = "French (Mali)" Case 180c Locale = "French (Monaco)" Case 380c Locale = "French (Morocco)" Case e40c Locale = "French (North Africa)" Case 200c Locale = "French (Reunion)" Case 280c Locale = "French (Senegal)" Case 100c Locale = "French (Switzerland)" Case 1c0c Locale = "French (West Indies)" Case 0462 Locale = "Frisian (Netherlands)" Case 0467 Locale = "Fulfulde (Nigeria)" Case 042f Locale = "FYRO Macedonian" Case 083c Locale = "Gaelic (Ireland)" Case 043c Locale = "Gaelic (Scotland)" Case 0456 Locale = "Galician" Case 0437 Locale = "Georgian" Case 0407 Locale = "German (Germany)" Case 0c07 Locale = "German (Austria)" Case 1407 Locale = "German (Liechtenstein)" Case 1007 Locale = "German (Luxembourg)" Case 0807 Locale = "German (Switzerland)" Case 0408 Locale = "Greek" Case 0474 Locale = "Guarani (Paraguay)" Case 0447 Locale = "Gujarati" Case 0468 Locale = "Hausa (Nigeria)" Case 0475 Locale = "Hawaiian (United States)" Case 040d Locale = "Hebrew" Case 0439 Locale = "Hindi" ' Case 040e Locale = "Hungarian" Case 0469 Locale = "Ibibio (Nigeria)" Case 040f Locale = "Icelandic" Case 0470 Locale = "Igbo (Nigeria)" Case 0421 Locale = "Indonesian" Case 045d Locale = "Inuktitut" Case 0410 Locale = "Italian (Italy)" Case 0810 Locale = "Italian (Switzerland)" Case 0411 Locale = "Japanese" Case 044b Locale = "Kannada" Case 0471 Locale = "Kanuri (Nigeria)" Case 0860 Locale = "Kashmiri" Case 0460 Locale = "Kashmiri (Arabic)" Case 043f Locale = "Kazakh" Case 0453 Locale = "Khmer" Case 0457 Locale = "Konkani" Case 0412 Locale = "Korean" Case 0440 Locale = "Kyrgyz (Cyrillic)" Case 0454 Locale = "Lao" Case 0476 Locale = "Latin" Case 0426 Locale = "Latvian" Case 0427 Locale = "Lithuanian" ' Case 043e Locale = "Malay (Malaysia)" ' Case 083e Locale = "Malay (Brunei Darussalam)" Case 044c Locale = "Malayalam" Case 043a Locale = "Maltese" Case 0458 Locale = "Manipuri" Case 0481 Locale = "Maori (New Zealand)" ' Case 044e Locale = "Marathi" Case 0450 Locale = "Mongolian (Cyrillic)" Case 0850 Locale = "Mongolian (Mongolian)" Case 0461 Locale = "Nepali" Case 0861 Locale = "Nepali (India)" Case 0414 Locale = "Norwegian (Bokmål)" Case 0814 Locale = "Norwegian (Nynorsk)" Case 0448 Locale = "Oriya" Case 0472 Locale = "Oromo" Case 0479 Locale = "Papiamentu" Case 0463 Locale = "Pashto" Case 0415 Locale = "Polish" Case 0416 Locale = "Portuguese (Brazil)" Case 0816 Locale = "Portuguese (Portugal)" Case 0446 Locale = "Punjabi" Case 0846 Locale = "Punjabi (Pakistan)" Case 046B Locale = "Quecha (Bolivia)" Case 086B Locale = "Quecha (Ecuador)" Case 0C6B Locale = "Quecha (Peru)" Case 0417 Locale = "Rhaeto-Romanic" Case 0418 Locale = "Romanian" Case 0818 Locale = "Romanian (Moldava)" Case 0419 Locale = "Russian" Case 0819 Locale = "Russian (Moldava)" Case 043b Locale = "Sami (Lappish)" Case 044f Locale = "Sanskrit" Case 046c Locale = "Sepedi" Case 0c1a Locale = "Serbian (Cyrillic)" Case 081a Locale = "Serbian (Latin)" Case 0459 Locale = "Sindhi (India)" Case 0859 Locale = "Sindhi (Pakistan)" Case 045b Locale = "Sinhalese (Sri Lanka)" Case 041b Locale = "Slovak" Case 0424 Locale = "Slovenian" Case 0477 Locale = "Somali" ' Case 042e Locale = "Sorbian" Case 0c0a Locale = "Spanish (Spain - Modern Sort)" Case 040a Locale = "Spanish (Spain - Traditional Sort)" Case 2c0a Locale = "Spanish (Argentina)" Case 400a Locale = "Spanish (Bolivia)" Case 340a Locale = "Spanish (Chile)" Case 240a Locale = "Spanish (Colombia)" Case 140a Locale = "Spanish (Costa Rica)" Case 1c0a Locale = "Spanish (Dominican Republic)" Case 300a Locale = "Spanish (Ecuador)" Case 440a Locale = "Spanish (El Salvador)" Case 100a Locale = "Spanish (Guatemala)" Case 480a Locale = "Spanish (Honduras)" Case 580a Locale = "Spanish (Latin America)" Case 080a Locale = "Spanish (Mexico)" Case 4c0a Locale = "Spanish (Nicaragua)" Case 180a Locale = "Spanish (Panama)" Case 3c0a Locale = "Spanish (Paraguay)" Case 280a Locale = "Spanish (Peru)" Case 500a Locale = "Spanish (Puerto Rico)" Case 540a Locale = "Spanish (United States)" Case 380a Locale = "Spanish (Uruguay)" Case 200a Locale = "Spanish (Venezuela)" Case 0430 Locale = "Sutu" Case 0441 Locale = "Swahili" Case 041d Locale = "Swedish" Case 081d Locale = "Swedish (Finland)" Case 045a Locale = "Syriac" Case 0428 Locale = "Tajik" Case 045f Locale = "Tamazight (Arabic)" Case 085f Locale = "Tamazight (Latin)" Case 0449 Locale = "Tamil" Case 0444 Locale = "Tatar" Case 044a Locale = "Telugu" ' Case 041e Locale = "Thai" Case 0851 Locale = "Tibetan (Bhutan)" Case 0451 Locale = "Tibetan (PRC)" Case 0873 Locale = "Tigrigna (Eritrea)" Case 0473 Locale = "Tigrigna (Ethiopia)" Case 0431 Locale = "Tsonga" Case 0432 Locale = "Tswana" Case 041f Locale = "Turkish" Case 0442 Locale = "Turkmen" Case 0480 Locale = "Uighur (China)" Case 0422 Locale = "Ukrainian" Case 0420 Locale = "Urdu" Case 0820 Locale = "Urdu (India)" Case 0843 Locale = "Uzbek (Cyrillic)" Case 0443 Locale = "Uzbek (Latin)" Case 0433 Locale = "Venda" Case 042a Locale = "Vietnamese" Case 0452 Locale = "Welsh" Case 0434 Locale = "Xhosa" Case 0478 Locale = "Yi" Case 043d Locale = "Yiddish" Case 046a Locale = "Yoruba" Case 0435 Locale = "Zulu" Case 04ff Locale = "HID (Human Interface Device)" Case Else Locale = "Could Not Determine OS Locale" End Select '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_OperatingSystem class: Caption = objOSItem.Caption CSDVersion = objOSItem.CSDVersion CSName = objOSItem.CSName Version = objOSItem.Version BuildType = objOSItem.BuildType BuildNumber = objOSItem.BuildNumber SerialNumber = objOSItem.SerialNumber ScriptHelper.SWbemDateTime.Value = objOSItem.InstallDate InstallDate = ScriptHelper.SWbemDateTime.GetVarDate(True) ScriptHelper.SWbemDateTime.Value = objOSItem.LastBootUpTime LastBootUpTime = ScriptHelper.SWbemDateTime.GetVarDate(True) Status = objOSItem.Status Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_ComputerSystem class: For Each objCompSysItem in colCompSysItems CurrentTimeZone = objCompSysItem.CurrentTimeZone DaylightInEffect = objCompSysItem.DaylightInEffect TotalMemory = FormatNumber(objCompSysItem.TotalPhysicalMemory/1024^3, 2) Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_TimeZone class: For Each objTZItem in colTZItems TZName = objTZItem.StandardName Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_ComputerSystemProduct class: For Each objCompSysProdItem in colCompSysProdItems CompSysName = objCompSysProdItem.Name IdentifyingNumber = objCompSysProdItem.IdentifyingNumber UUID = objCompSysProdItem.UUID Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_BIOS class: For Each objBIOSItem in colBIOSItems SMBIOSVersion = objBIOSItem.SMBIOSBIOSVersion Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Start echoing output to the screen Wscript.Echo " ------------------------------------------" Wscript.Echo " System Details" Wscript.Echo " ------------------------------------------" Wscript.Echo "" Wscript.Echo " Computer Name: " & CSName Wscript.Echo "" Wscript.Echo "" Wscript.Echo " Operating System Information:" Wscript.Echo " =============================" Wscript.Echo " Operating System: " & Caption & Arch Wscript.Echo " Version: " & Version & " " & Sku & " " & CSDVersion Wscript.Echo " Build Type: " & BuildType Wscript.Echo " Locale: " & Locale Wscript.Echo " Serial Number: " & SerialNumber Wscript.Echo "" Wscript.Echo " Current Time Zone: " & TZName Wscript.Echo " Offset from UTC: " & CurrentTimeZone/60 & " hours" Wscript.Echo " DST In Effect: " & DaylightInEffect Wscript.Echo "" '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Get the product keys (function at the end of script): GetKeys() Wscript.Echo "" Wscript.Echo " Install Date: " & InstallDate Wscript.Echo " Last Boot Time: " & LastBootUpTime Wscript.Echo " Local Date/Time: " & Now() Wscript.Echo "" Wscript.Echo " System Status: " & Status Wscript.Echo "" Wscript.Echo "" Wscript.Echo " Hardware Information:" Wscript.Echo " =====================" '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set and echo variables gathered from Win32_Processor class: For Each objProcItem in colProcItems Select Case objProcItem.Architecture Case 0 CPUArch = "x86" Case 1 CPUArch = "MIPS" Case 2 CPUArch = "Alpha" Case 3 CPUArch = "PowerPC" Case 6 CPUArch = "Itanium" Case 9 CPUArch = "x64" Case Else CPUArch = "Could Not Determine CPU Architecture" End Select Wscript.Echo " CPU: " & objProcItem.Name & " (" & CPUArch & ")" Next Wscript.Echo "" Wscript.Echo " Physical Memory: " & TotalMemory & " GB" Wscript.Echo "" '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_VideoController class: For Each objVideoItem in colVideoItems Wscript.Echo " Video Card: " & objVideoItem.Name If Not objVideoItem.AdapterDACType = "" Then Wscript.Echo " Adapter DAC: " & objVideoItem.AdapterDACType End if Wscript.Echo " PNP Device ID: " & objVideoItem.PNPDeviceID If Not objVideoItem.AdapterRAM = "" Then Wscript.Echo " Video RAM: " & objVideoItem.AdapterRAM/1024^2 & " MB" End If Wscript.Echo " Driver Version: " & objVideoItem.DriverVersion On Error Resume Next ScriptHelper.SWbemDateTime.Value = objVideoItem.DriverDate If Err.number <> 0 Then DriverDate = "" ' No DriverDate, do not echo Else DriverDate = ScriptHelper.SWbemDateTime.GetVarDate(False) Wscript.Echo " Driver Date: " & DriverDate End If On Error Goto 0 Wscript.Echo "" Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_SoundDevice class: For Each objSoundItem in colSoundItems Wscript.Echo " Sound Card: " & objSoundItem.Name Wscript.Echo " Manufacturer: " & objSoundItem.Manufacturer Wscript.Echo " PNP Device ID: " & objSoundItem.PNPDeviceID Wscript.Echo "" Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_LogicalDisk class: For Each objDiskItem in colDiskItems If objDiskItem.DriveType = 3 Then Wscript.Echo " Volume: " & objDiskItem.Caption Wscript.Echo " Compressed: " & objDiskItem.Compressed Wscript.Echo " File System: " & objDiskItem.FileSystem Wscript.Echo " Volume Size: " & FormatNumber(objDiskItem.Size/1024^3, 2) & " GB" Wscript.Echo " Free Space: " & FormatNumber(objDiskItem.FreeSpace/1024^3, 2) & " GB" Wscript.Echo "" End If Next '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Set variables gathered from Win32_NetworkAdapterConfiguration class: For Each objNetAdapConfigItem in colNetAdapConfigItems If isNull(objNetAdapConfigItem.IPAddress) Then '// Skip adapter, not currently used Else Wscript.Echo " Network Adapter: " & objNetAdapConfigItem.Description Wscript.Echo " MAC Address: " & objNetAdapConfigItem.MACAddress Wscript.Echo " DHCP Enabled: " & objNetAdapConfigItem.DHCPEnabled Wscript.Echo " IP Address: " & Join(objNetAdapConfigItem.IPAddress, ",") On Error Resume Next SubnetMask = Join(objNetAdapConfigItem.IPSubnet, ",") If Err <> 0 Then 'IP Address is likely 0.0.0.0, so no Subnet Mask or Gateway (Join will fail on NULL) Else Wscript.Echo " Default Gateway: " & Join(objNetAdapConfigItem.DefaultIPGateway, ",") Wscript.Echo " Subnet Mask: " & SubnetMask End If On Error Goto 0 If objNetAdapConfigItem.DHCPEnabled = True Then ScriptHelper.SWbemDateTime.Value = objNetAdapConfigItem.DHCPLeaseObtained DHCPLeaseObtained = ScriptHelper.SWbemDateTime.GetVarDate(True) Wscript.Echo " Lease Obtained: " & DHCPLeaseObtained ScriptHelper.SWbemDateTime.Value = objNetAdapConfigItem.DHCPLeaseExpires DHCPLeaseExpires = ScriptHelper.SWbemDateTime.GetVarDate(True) Wscript.Echo " Lease Exipres: " & DHCPLeaseExpires Wscript.Echo " DHCP Servers: " & objNetAdapConfigItem.DHCPServer End If Wscript.Echo " DNS Server: " & Join(objNetAdapConfigItem.DNSServerSearchOrder, ",") If Not objNetAdapConfigItem.WINSPrimaryServer = "" Then Wscript.Echo " WINS Primary Server: " & objNetAdapConfigItem.WINSPrimaryServer If Not objNetAdapConfigItem.WINSSecondaryServer = "" Then Wscript.Echo " WINS Secondary Server: " & objNetAdapConfigItem.WINSPrimaryServer End If Wscript.Echo " Enable LMHosts Lookup: " & objNetAdapConfigItem.WINSEnableLMHostsLookup End If Wscript.Echo "" End If Next Wscript.Echo "" Wscript.Echo " System Information:" Wscript.Echo " ===================" Wscript.Echo " Computer: " & CompSysName Wscript.Echo " Serial Number: " & IdentifyingNumber Wscript.Echo " BIOS Version: " & SMBIOSVersion Wscript.Echo " UUID: " & UUID Wscript.Echo "" '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// This pause call is disabled, but you may wish to enable it if running this script '// with the ElevateThisScript() subroutine call enabled above: ' PressEnter() '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Functions: GetKeys() and decodeKey(iValues, strProduct) '// '// Credit where credit is due - I found and modified script posted by user "Parabellum" '// found on http://www.visualbasicscript.com/m42793.aspx, hacked it up a bit, and used '// it here to post keys: Public Function GetKeys() For x = LBound(arrSubKeys, 1) To UBound(arrSubKeys, 1) ScriptHelper.Registry.GetBinaryValue HKEY_LOCAL_MACHINE, arrSubKeys(x,1), SEARCH_KEY, arrDPIDBytes If Not IsNull(arrDPIDBytes) Then Call decodeKey(arrDPIDBytes, arrSubKeys(x,0)) Else ScriptHelper.Registry.EnumKey HKEY_LOCAL_MACHINE, arrSubKeys(x,1), arrGUIDKeys If Not IsNull(arrGUIDKeys) Then For Each GUIDKey In arrGUIDKeys ScriptHelper.Registry.GetBinaryValue HKEY_LOCAL_MACHINE, arrSubKeys(x,1) & "\" & GUIDKey, SEARCH_KEY, arrDPIDBytes If Not IsNull(arrDPIDBytes) Then Call decodeKey(arrDPIDBytes, arrSubKeys(x,0)) End If Next End If End If Next End Function Public Function decodeKey(iValues, strProduct) Dim arrDPID arrDPID = Array() For i = 52 to 66 ReDim Preserve arrDPID( UBound(arrDPID) + 1 ) arrDPID( UBound(arrDPID) ) = iValues(i) Next Dim arrChars arrChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9") For i = 24 To 0 Step -1 k = 0 For j = 14 To 0 Step -1 k = k * 256 Xor arrDPID(j) arrDPID(j) = Int(k / 24) k = k Mod 24 Next strProductKey = arrChars(k) & strProductKey If i Mod 5 = 0 And i <> 0 Then strProductKey = "-" & strProductKey End If Next ReDim Preserve foundKeys( UBound(foundKeys) + 1 ) foundKeys( UBound(foundKeys) ) = strProductKey strKey = UBound(foundKeys) Wscript.Echo " " & strProduct & "" & foundKeys(strKey) End Function '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// Subroutine: PressEnter() '// '// Adds a pause with a "Press the ENTER key to continue." message when called. '// '// Usage: Call this Subroutine to get a pause that will clear when the user presses the '// ENTER key (and ONLY the ENTER key) on their keyboard: Sub PressEnter() Wscript.Echo "" strMessage = "Press the ENTER key to continue. " Wscript.StdOut.Write strMessage Do While Not WScript.StdIn.AtEndOfLine Input = WScript.StdIn.Read(1) Loop End Sub '// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// '// ScriptHelperClass and EnvironmentClass are helper classes to simplify '// script work. Declare and use globally throughout the script. '// '// Example code: '// '// Option Explicit '// Dim ScriptHelper '// Set ScriptHelper = New ScriptHelperClass '// ScriptHelper.RunMeWithCScript() '// ScriptHelper.ElevateThisScript() '// WScript.Echo "User profile : " & ScriptHelper.Environment.UserProfile '// WScript.Echo "Domain : " & ScriptHelper.Network.UserDomain '// ScriptHelper.CreateFolder "\\SERVER\Share\Folder\With\Path" '// ScriptHelper.FileSystem.FileExists("C:\command.com") '// ScriptHelper.Shell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType") '// '// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Class ScriptHelperClass Private objEnvironment Private objFileSystem Private objNetwork Private objShell Private objSWBemlocator Private objWMI Private objRegistry Private objSWbemDateTime Public Computer Public Property Get Environment If objEnvironment Is Nothing Then Set objEnvironment = New EnvironmentClass objEnvironment.Shell = Shell End If Set Environment = objEnvironment End Property Public Property Get FileSystem If objFileSystem Is Nothing Then Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set FileSystem = objFileSystem End Property Public Property Get Network If objNetwork Is Nothing Then Set objNetwork = CreateObject("WScript.Network") Set Network = objNetwork End Property Public Property Get Shell If objShell Is Nothing Then Set objShell = CreateObject("WScript.Shell") Set Shell = objShell End Property Public Property Get WMI If objWMI Is Nothing Then On Error Resume Next Set objSWBemlocator = CreateObject("WbemScripting.SWbemLocator") Set objWMI = objSWBemlocator.ConnectServer(Computer, "root\CIMV2") objWMI.Security_.ImpersonationLevel = 3 On Error Goto 0 End If Set WMI = objWMI End Property Public Property Get Registry If objRegistry Is Nothing Then Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Set Registry = objRegistry End Property Public Property Get SWbemDateTime If objSWbemDateTime Is Nothing Then Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime") Set SWbemDateTime = objSWbemDateTime End Property Private Sub Class_Initialize() Computer = "." Set objEnvironment = Nothing Set objFileSystem = Nothing Set objNetwork = Nothing Set objShell = Nothing Set objSWBemlocator = Nothing Set objWMI = Nothing Set objRegistry = Nothing Set objSWbemDateTime = Nothing End Sub Private Sub Class_Terminate Set objSWbemDateTime = Nothing Set objRegistry = Nothing Set objWMI = Nothing Set objSWBemlocator = Nothing Set objShell = Nothing Set objNetwork = Nothing Set objFileSystem = Nothing Set objEnvironment = Nothing End Sub Public Property Get ScriptPath() ScriptPath = FileSystem.GetFile(WScript.ScriptFullName).ParentFolder End Property Public Function GetCurrentUserSID() Dim intCount, colItems, objItem, strSID Set colItems = WMI.ExecQuery("SELECT * FROM Win32_UserAccount WHERE Name = '" & Network.Username & "' AND Domain = '" & Network.UserDomain & "'", , 48) intCount = 0 For Each objItem In colItems strSID = Cstr(objItem.SID) intCount = intCount + 1 Next If intCount > 0 Then GetCurrentUserSID = strSID Else GetCurrentUserSID = "NOTFOUND" End If End Function Public Sub CreateFolder(strFldPath) Dim fldArray, x, intStartIndex, blnUNC, strDestFold : strDestFold = "" If Left(strFldPath, 2) = "\\" Then blnUNC = True intStartIndex = 3 'Start at the first folder in UNC path Else blnUNC = False intStartIndex = 0 End If fldArray = Split(strFldPath, "\") 'Split folders into array If fldArray(intStartIndex) = "" Then Exit Sub For x = intStartIndex To UBound(fldArray) If strDestFold = "" Then If blnUNC Then strDestFold = "\\" & fldArray(x-1) & "\" & fldArray(x) 'Prefix UNC with server and share Else strDestFold = fldArray(x) End If Else strDestFold = strDestFold & "\" & fldArray(x) 'Append each folder to end of path End If If Not FileSystem.FolderExists(strDestFold) Then FileSystem.CreateFolder(strDestFold) Next End Sub Public Sub DeleteFolder(strFldPath) If FileSystem.FolderExists(strFldPath) Then FileSystem.DeleteFolder strFldPath, True End Sub '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// Subroutine: RunMeWithCScript() '// '// Purpose: Forces the currently running script to use Cscript.exe as the Script '// engine. If the script is already running with cscript.exe the sub exits '// and continues the script. '// '// Sub Attempts to call the script with its original arguments. Arguments '// that contain a space will be wrapped in double quotes when the script '// calls itself again. To verify your command string you can echo out the '// scriptCommand variable. '// '// Usage: Add a call to this sub (RunMeWithCscript) to the beggining of your script '// to ensure that cscript.exe is used as the script engine. '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Public Sub RunMeWithCScript() Dim scriptEngine, engineFolder, Args, arg, scriptName, argString, scriptCommand scriptEngine = Ucase(Mid(Wscript.FullName,InstrRev(Wscript.FullName,"\")+1)) engineFolder = Left(Wscript.FullName,InstrRev(Wscript.FullName,"\")) argString = "" If scriptEngine = "WSCRIPT.EXE" Then Dim Shell : Set Shell = CreateObject("Wscript.Shell") Set Args = Wscript.Arguments For each arg in Args 'loop though argument array as a collection to rebuild argument string If instr(arg," ") > 0 Then arg = """" & arg & """" 'if the argument contains a space wrap it in double quotes argString = argString & " " & Arg Next 'Create a persistent command prompt for the cscript output window and call the script with its original arguments scriptCommand = "cmd.exe /k " & engineFolder & "cscript.exe """ & Wscript.ScriptFullName & """" & argString Shell.Run scriptCommand,,False Wscript.Quit Else Exit Sub 'Already Running with Cscript Exit this Subroutine End If End Sub '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '// Subroutine: ElevateThisScript() '// '// Purpose: (Intended for Vista+) '// Forces the currently running script to prompt for UAC elevation if it '// detects that the current user credentials do not have administrative '// privileges. '// '// If run on Windows XP this script will cause the RunAs dialog to appear if '// the user does not have administrative rights, giving the opportunity to '// run as an administrator. '// '// This Sub Attempts to call the script with its original arguments. '// Arguments that contain a space will be wrapped in double quotes when the '// script calls itself again. '// '// Usage: Add a call to this sub (ElevateThisScript) to the beginning of your '// script to ensure that the script gets an administrative token. '//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Public Sub ElevateThisScript() Const HKEY_CLASSES_ROOT = &H80000000 Const HKEY_CURRENT_USER = &H80000001 Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 const KEY_QUERY_VALUE = 1 Const KEY_SET_VALUE = 2 Dim scriptEngine, engineFolder, argString, arg, Args, scriptCommand, HasRequiredRegAccess Dim objShellApp : Set objShellApp = CreateObject("Shell.Application") scriptEngine = Ucase(Mid(Wscript.FullName,InstrRev(Wscript.FullName,"\")+1)) engineFolder = Left(Wscript.FullName,InstrRev(Wscript.FullName,"\")) argString = "" Set Args = Wscript.Arguments For each arg in Args 'loop though argument array as a collection to rebuild argument string If instr(arg," ") > 0 Then arg = """" & arg & """" 'if the argument contains a space wrap it in double quotes argString = argString & " " & Arg Next scriptCommand = engineFolder & scriptEngine Dim objReg, bHasAccessRight Set objReg=GetObject("winmgmts:"_ & "{impersonationLevel=impersonate}!\\" &_ Computer & "\root\default:StdRegProv") 'Check for administrative registry access rights objReg.CheckAccess HKEY_LOCAL_MACHINE, "System\CurrentControlSet\Control\CrashControl", _ KEY_SET_VALUE, bHasAccessRight If bHasAccessRight = True Then HasRequiredRegAccess = True Exit Sub Else HasRequiredRegAccess = False objShellApp.ShellExecute scriptCommand, " """ & Wscript.ScriptFullName & """" & argString, "", "runas" WScript.Quit End If End Sub End Class Class EnvironmentClass Private objShell Private strLogonServer Private strProgramFiles Private strProgramFilesX86 Private strUserProfile Private strWinDir Public Cache Public Property Let Shell(objParentShell) Set objShell = objParentShell End Property Public Property Get LogonServer If IsNull(strLogonServer) Or Cache = False Then strLogonServer = objShell.ExpandEnvironmentStrings("%LOGONSERVER%") LogonServer = strLogonServer End Property Public Property Get ProgramFiles If IsNull(strProgramFiles) Or Cache = False Then strProgramFiles = objShell.ExpandEnvironmentStrings("%PROGRAMFILES%") ProgramFiles = strProgramFiles End Property Public Property Get ProgramFilesX86 If IsNull(strProgramFilesX86) Or Cache = False Then strProgramFilesX86 = objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") ProgramFilesX86 = strProgramFilesX86 End Property Public Property Get UserProfile If IsNull(strUserProfile) Or Cache = False Then strUserProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%") UserProfile = strUserProfile End Property Public Property Get WinDir If IsNull(strWinDir) Or Cache = False Then strWinDir = objShell.ExpandEnvironmentStrings("%WINDIR%") WinDir = strWinDir End Property Private Sub Class_Initialize() Cache = True strLogonServer = Null strProgramFiles = Null strProgramFilesX86 = Null strUserProfile = Null strWinDir = Null End Sub End Class
  21. To the OP, if this is going to get complicated you might want to migrate from a CMD to a vbscript - certain things are easier to grep and act on, and the environment is a bit more powerful.
  22. See if that does anything for you - I've added error handling around the check, so it should skip past it if it fails. I don't do any logging or output to screen if it fails, but you could do that if you want. I go for aesthetically pleasing in something like this, so any failure to look up a line item should be dealt with silently in something this simple, in my opinion.
  23. Runs perfectly fine here in XPSP2 and XPSP3 (it was introduced in XP, so it wouldn't work on a 2K machine, but it should on an XPSP3 box). Also, it says generic failure, not "not supported", which means it tried and failed. Try changing the (false) to (true) at the end and see what happens - false tells the command to interpret the time passed in as UTC rather than local offset, so try it as (true) to force a local offset time to the command instead (it is the only one that is false, the other GetVarDate calls are all passed as local offset time). It's trying to grep the timestamp on your video card driver, and it is possible the date is causing GetVarDate to fail interpreting that as UTC.
  24. You use dism to add the .cab file that exists when you extract the package to a WinPE 2.1 or 3.0 .wim file to "install" the hotfix. It doesn't actually install on a full OS.
  25. IE 5.01 and IE6 SP1 are supported on W2K - IE 5.5 is not. Microsoft changed the IE support policy somewhat when XP was released - prior to Windows XP, Microsoft only supported the IE version that shipped directly with the OS at install (IE 5.0) and the last version available when the product went into extended support (IE6 SP1). The "middle" product (IE 5.5) was retired on 31 December 2005. Microsoft currently supports IE6, IE7, and IE8 on Windows XP systems even though IE7 is the "middle" product - IE8 released before XP went into extended support, and IE6 was the version that installed with XP, but Microsoft currently continues to support IE7 on XP. I don't know if that's going to be permanent or not until 2014 when XP EOLs (I hope not), but it might.So, to recap, see here for a list of supported IE versions and the versions of Windows they're supported on. IE 5.01 and IE6 SP1 are supported on W2K SP4 until W2K EOLs on 13 July 2010, but IE 5.5 was retired on 31 December 2005.
×
×
  • Create New...