Link to home
Create AccountLog in
Avatar of yo_bee
yo_beeFlag for United States of America

asked on

WMIC Call Win32Shutdown returns Invalid method Parameter(s)

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?
Avatar of wwwb0n3zcom
wwwb0n3zcom
Flag of United States of America image

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

Avatar of yo_bee

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of wwwb0n3zcom
wwwb0n3zcom
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of yo_bee

ASKER

@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.
Avatar of yo_bee

ASKER

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:
Avatar of yo_bee

ASKER

Will do. Thanks for the additional advice