How to run a PowerShell script from a batch file

I am trying to run this script in PowerShell. I have saved the below script as ps.ps1 on my desktop. $query = “SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 2” Register-WMIEvent -Query $query -Action { invoke-item “C:\Program Files\abc.exe”} I have made a batch script to run this PowerShell script @echo off Powershell.exe set-executionpolicy remotesigned -File … Read more

How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

I want my batch file to only run elevated. If not elevated, provide an option for the user to relaunch batch as elevated. I’m writing a batch file to set a system variable, copy two files to a Program Files location, and start a driver installer. If a Windows 7/Windows Vista user (UAC enabled and even if … Read more