|16 Sep 2011||#1|
Portin from Batch to Powershell?
Im starting to work with powershell and try to port my old batch files.
Im encounter some problem you may help me with.
I got this lines of Code, and I dont know who to convert them to power shell.
The goal is to uninstall a software using the string found in the registry.
echo Uninstall old Software now for /F "tokens=1,*" %%i in ('reg query HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\ /s /f APPLICATIONNAME ^|find "Uninstall"') do set StringSearch=%%i for /f "tokens=1,2,3,4,5,6,7 delims=\" %%a in ("%StringSearch%") do set ProdID=%%g echo ... MsiExec.exe /x%ProdID% /quiet
What would be the best practice for power shell.
3) Another question is if it is posible with power shell to tell the system (Win7 and/or Xp)
to do a Windows System Update and install all critical updates?
|My System Specs|
|21 Sep 2011||#3|
Hey got some similar problems.
Remote execution could look like:
(Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ip -Credential $cred).InvokeMethod("Win32Shutdown",3)
I'm not sure if this method works for all needs.
I'm also interested in invoking system update via powershell.
|My System Specs|
|Similar help and support threads for2: Portin from Batch to Powershell?|
|How to run a batch file at logoff & some batch scripting help please||Backup and Restore|
|Batch rename in DOS or Windows Powershell||General Discussion|
|PowerShell 3.0 for Win 7 now available||News|
|Batch File that grabs file names from folder to insert into batch file||General Discussion|
|powershell 1 or 2?||General Discussion|
|do you use powershell?||General Discussion|
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
All times are GMT -5. The time now is 11:36 AM.