![]() ![]() I've also tried to do this via a text file relay: wmic /OUTPUT:%~dp0\wmic. That's exactly what I'm seeing so it's weird, and also the parameter is being set, echo'd then unset. Notice the output is missing the drive letter. If I run the batch with ON, I get this: :\Users\Administrator>echo Which means the %PROD% variable isn't defined at all. Using wmic command to get information about computer and write to file To use: Right click on File name > Left click on 'Run in Powershell' Or hit F5 from within Powershell ISE editor Create a file on the C drive out-file c:tempcomputerinfofile.txt Get the serial number and overwrite text file if it exists already wmic bios get serialnumber > c:tempcomputerinfofile. Which outputs: C:\Users\Administrator>ECHO is off. 'wmic product where "Name like '%product-name%' get name' Here's the for loop I'm trying to use to get this to work: off ^ and an extra carriage return, and that carriage return is the issue. I've tried a couple of different ways of pulling the uninstall info and the only one I've landed on that's come close is using WMIC: wmic product where "Name like '%product name%'" get name Because of this, I can't build a static uninstall location based on the registry as the uninstaller string also is under the same SSID in the registry. The issue I'm running across is that the uninstaller for the application I'm trying to remove is created under an auto-generated SSID on each system (e.g.: C:\ProgramData\program-name\Uninstall.exe). NODE Servers the alias will operate against. ROLE Path for the role containing the alias definitions. C:\>wmic / global switchesI've been struggling to get a specific output using WMIC in batch in order to build an automatic uninstall script. And there is no /DOMAIN option in wmic either.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |