We help IT Professionals succeed at work.

WMIC Call Win32Shutdown returns  Invalid method Parameter(s)

yo_bee
yo_bee asked
on
When I run: WMIC /node:@"C:\computerlist.txt" OS Call Win32Shutdown(9,0)
It returns
ERROR:
Description = Invalid method Parameter(s)

Why is this?

Also How to I suppress (Y/N)? prompt?
Comment
Watch Question

Question - is there a reason you want to use WMIC? this can also be acomplished by using many other tools (VBS, PowerShell, SysInternals tools).

an example using PowerShell:
http://www.infotechguyz.com/cmd/powershellshutdownlist.html

yo_beeDirector of Information Technology
CERTIFIED EXPERT

Author

Commented:
I have a file of all my servers and I want to use the @filename paramerter.

I have used VBS for querying WMI, but never to CALL. thought it would be easier.

I am more than happy to use PS or VBS.

I will try the link now.
You should still be able to use the txt based file if it's formated correctly (one workstation or server per line would be the easiest).

If you wanted to still use the WMIC - you might want to look at your parameters. I'm not familiar with a flag of 9.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394058(v=vs.85).aspx

Here is another examle from Microsoft using WMIC to shut down a list.
http://support.microsoft.com/servicedesks/webcasts/wc072402/listofsampleusage.asp
Under "OS (Win32_OperatingSystem). You may not require Local and Organization for the Where statement.
yo_beeDirector of Information Technology
CERTIFIED EXPERT

Author

Commented:
@wwwb0n3

The second link pointed me in the right direction.
Now I need to find a way to suppress the Y/N Prompt
Take a look at this link and the /interactive switch.
http://technet.microsoft.com/en-us/library/cc787035(WS.10).aspx

try adding /nointeractive to the end of your command line.
yo_beeDirector of Information Technology
CERTIFIED EXPERT

Author

Commented:
Thanks for the pointers. I found the suppress prompt (y/n)?

It is /Nointeractive.
I would also suggest looking at the failfast switch... This way it would ping each workstation/server in your list before executing the command. So add the following just after WMIC.

example:
WMIC /FAILFAST:ON /NODE:
yo_beeDirector of Information Technology
CERTIFIED EXPERT

Author

Commented:
Will do. Thanks for the additional advice