Recently changed pages
Date and Time Last Edited By:quux
( 30 - days ago )
Fragmentation Last Edited By:quux
( 61 - days ago )
Remotely change IPs en masse Last Edited By:quux
( 297 - days ago )
70.293 (Plan/maintain W2003 Network) Last Edited By:quux
( 370 - days ago )
Enumerate Computers Last Edited By:quux
( 437 - days ago )
Sleep ten seconds Last Edited By:quux
( 457 - days ago )
Microsoft technology links Last Edited By:quux
( 482 - days ago )
Reference Links Last Edited By:quux
( 553 - days ago )
Security comparisons (Operating Systems, Browsers, Web Servers) Last Edited By:quux
( 580 - days ago )
WMIC Snippets Last Edited By:quux
( 646 - days ago )
More »
Recently Attached FilesMore » |
Newly added pages
Remotely change IPs en masse Author: quux ( 297 days ago )
70.293 (Plan/maintain W2003 Network) Author: quux ( 370 days ago )
Security comparisons (Operating Systems, Browsers, Web Servers) Author: quux ( 580 days ago )
Stretching for the cube doughboy Author: quux ( 687 days ago )
nix Author: quux ( 689 days ago )
Recent comments
More »
|
TIMEOUT [/T] timeout [/NOBREAK]
Description:
This utility accepts a timeout parameter to wait for the specified
time period (in seconds) or until any key is pressed. It also
accepts a parameter to ignore the key press.
Thanks!!
WMIC /NODE:remote_computer_name /NAMESPACE:\\root\vm\virtualserver PATH VirtualMachine GET
WMIC /NODE:remote_computer_name /NAMESPACE:\\root\vm\virtualserver PATH VirtualMachine GET Name,Uptime,PhysicalMemoryAllocated
This gives the equivalent to the VBS script, so should give folk an idea what to do to translate WMIC commandlines to scripts and vice-versa.
strComputer = "remote_computer_name"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\vm\virtualserver")
Set colVMs = objWMIService.ExecQuery("SELECT * FROM VirtualMachine",,48)
For Each vm in colVMs
Wscript.Echo vm.name & ":: Physical Memory Allocated: " & vm.PhysicalMemoryAllocated & " bytes)"
Next
I found CHOICE.exe a safer alternative:
choice /c yn /n /d y /t 10 > nul
Sorry it took me so long to see this comment and respond. Are you running the script from an account which is a member of Administrators?
6 update(s) found. 6 eligible for install by this script.
(This script will NOT download/install updates with I, H, N, or L properties.)
(Updates with the E property will be installed if /accepteula arg was given.)
Installing the updates. Again, it takes time.
C:\forinstall.vbs(265, 17) Microsoft VBScript runtime error: Permission denied
I linked to WMIC Snippets in my blog. I hope you dont mind that reference is just fantastic.
Like yourself I also use windows and *nixes and to be honest I prefer linux, but nevertheless I got tired of always listening how inferior cmd is to *nix shell, so I wrote a blog post on that few days back.
http://www.damirkucic.com/2009/07/cmdexe-tribute-to-old-friend.html
I hope I'm not to arrogant linking to it in comment but it's so "connected" with your thoughts on quuxutils (I'm linking too soon) page that I just had to.
Anyway thanks again for fantastic reference and some of your stuff is definitely bookmark.
But it doesn't really fit well in this script, because I often change the -n argument to 2 or more. In that way I can send multiple pings to the address, but still indicate success (host is up and reachable) if one or more pings get through.
You can simplify your ping test and use actual host names by using the logical_or "||" or logical_and "&&" symbols.
ping -n 1 %1 > nul || @goto pingfail
goto ping success
Focus passes through the || only if ping fails (ie errorlevel 1).
Steven Wettberg's Alive.exe program returns errorlevels for several different types of failures: ttl expired, bad destination, etc. So if you're testing for more types of failures, Alive.exe might be a better choice than ping.exe - ymmv.
Alive.exe might be a good candidate for your quuxutils collection.
Rob W.
Any ideas on returning a processes componenents, paths and versions? Like listdlls would produce?
Rob
- Preet
http://preetsangha.blogspot.com
wmic nic where "PNPDeviceID=PCI\VEN_xxxx&Dev_xxx&..." get macaddress
gets error: dev_xxxx is not recognized as an interna or external command.
(this repeat for each part of the string after the &
Help!