IGIdeus Posted August 23, 2004 Posted August 23, 2004 How can I get size of physical memory in batch file? Or processor speed.Best regardsIGIdeus
chesterguyca Posted August 23, 2004 Posted August 23, 2004 IGIdeus,Like many other posts here there is not enough information in your post for anyone to answer you properly.What OS do you have? What level is it patched to? What type of language are you programming in?At anyrate: Check out Microsofts WMI interface. You can easily program it using vbScript (or a lot of other languages). As for getting a DOS batch file to do it that would be more time consuming and require you to run other files from DOS.Good Luck,Chesterguy.
IGIdeus Posted August 23, 2004 Author Posted August 23, 2004 THX for explanation.Sorry for my inefficiency.I use "pure" batch files (.bat, .cmd) because most of them should works in Windows NT and XP.I made my own solution for English XP:@echo offFOR /F "tokens=4" %%G IN ('systeminfo ^| find ^"Total Physical Memory^"') DO ( if %%G LSS 500 ( reg /s classic_theme.reg))Any ideas for improvements?Best regardsIGIdeus
chesterguyca Posted August 23, 2004 Posted August 23, 2004 Igideus,It looks like you know your dos batch stuff, better than I still do, if you were able to write and understand that. I have not used NT DOS batch since starting with WSH, WMI with VBScript since they are more powerful, were super easy to get used to, and are Microsoft's prefered method of writing scripts (I still use some Perl, for fun).It looks like more work but after doing a few you will find its a lot easier. Here is script to determine processor speed and echo it to a window or dos line (depending on how you run it). Copy then paste it into a file with extention ".vbs" (note: WSH 5.6 must be installed).strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colComputer = objWMIService.ExecQuery("Select * from Win32_Processor",,48) For Each objComputer In colComputer varCPUSpeed = objComputer.CurrentClockSpeed Nextwscript.echo "CPUspeed: "&varCPUSpeedSorry, I am no help with the DOS. Hope this helped.
IGIdeus Posted August 24, 2004 Author Posted August 24, 2004 I have not used NT DOS batch since starting with WSH, WMI with VBScript since they are more powerful, were super easy to get used to, and are Microsoft's prefered method of writing scripts (I still use some Perl, for fun).Sorry, I am no help with the DOS. Hope this helped.I should learn WSH, WMI and VBScript if I want to make an extraordinary scripts.THX a lot :-)Best regardsIGIdeus
chesterguyca Posted August 24, 2004 Posted August 24, 2004 I don't think WMIC work with plain old user rights. Or?
CoffeeFiend Posted August 24, 2004 Posted August 24, 2004 WMI/vbscript rocks. It can do things like that but also a LOT more stuff. It's pretty amazing to see what you can do with it. I use it a lot.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now