Skip to content

Instantly share code, notes, and snippets.

@theznerd
Last active August 15, 2019 03:52
Show Gist options
  • Save theznerd/61080ed54af530189b7dc30f307c27bb to your computer and use it in GitHub Desktop.
Save theznerd/61080ed54af530189b7dc30f307c27bb to your computer and use it in GitHub Desktop.
Start-Process -Wait -WindowStyle Hidden -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -WindowStyle Hidden -Verb RunAs -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -Verb RunAs -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -WindowStyle Hidden -NoNewWindow -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -UseNewEnvironment -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -NoNewWindow -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -WindowStyle Hidden -UseNewEnvironment -FilePath "$PSScriptRoot\ServiceUI_x64.exe" -ArgumentList "-process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -FilePath "cmd.exe" -ArgumentList "/c `"$PSScriptRoot\ServiceUI_x64.exe`" -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -FilePath "cmd.exe" -ArgumentList "/c `"$PSScriptRoot\ServiceUI_x64.exe`" -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
Start-Process -Wait -WindowStyle Hidden -Verb RunAs -FilePath "cmd.exe" -ArgumentList "/c `"$PSScriptRoot\ServiceUI_x64.exe`" -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
Start-Process -Wait -WindowStyle Hidden -Verb RunAs -FilePath "cmd.exe" -ArgumentList "/c `"$PSScriptRoot\ServiceUI_x64.exe`" -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
& "$PSScriptRoot\ServiceUI_x64.exe -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File \`"$PSScriptRoot\UserNotification.ps1\`" -SettingsFile \`"$PSScriptRoot\Settings.ini\`""
& "cmd.exe /c $PSScriptRoot\ServiceUI_x64.exe -process:tsprogressui.exe `"c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe`" -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$PSScriptRoot\UserNotification.ps1`" -SettingsFile `"$PSScriptRoot\Settings.ini`""
### Here's the lines that work in a batch script ###
"%~dp0ServiceUI_x86.exe" -process:tsprogressui.exe "c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe" -ExecutionPolicy Bypass -WindowStyle Hidden -File \"%~dp0UserNotification.ps1\" -SettingsFile \"%~dp0Settings.ini\"
"%~dp0ServiceUI_x64.exe" -process:tsprogressui.exe "c:\Windows\System32\WindowsPowershell\v1.0\powershell.exe" -ExecutionPolicy Bypass -WindowStyle Hidden -File \"%~dp0UserNotification.ps1\" -SettingsFile \"%~dp0Settings.ini\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment