Hi everyone,
I have been trying to find a way to start Blue Iris Tools automatically when my windows10 VM starts/restarts without disabling UAC prompts without much luck.
Although the program has a 'start when windows boots' option, it gets stuck on a UAC prompt waiting for someone to click yes or eventually times out and the program doesn't start.
Yesterday I finally found a way to do this and I thought I'd share for everyone else and my future self looking for how to do this in 2 years time lol.
This requires you to have an administrator account with a password set on your windows 10 machine / vm.
Step 1)
Install Blue Iris Tools as normal, in the default install location. After the install, do not select the 'Start when windows boots' tickbox. I've also selected 'Minimize to tray'
Step 2)
Go to Documents and create a new .txt file. Put the following text into the txt file:
Step 3)
Save the file and rename it to BITools_startup_script.ps1
Step 4)
Go to start, type 'run' and in run type 'shell:startup'
This should take you to C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Alternatively just navigate to the path above if you don't want to use run
Step 5)
Create another .txt file and paste the following inside:
Step 6)
Rename the .txt file to BIT_startup.cmd
That's it! BIT will now start as admin every time the windows 10 machine starts up, without actually needing to login.
You can confirm this works by simply double clicking the .cmd file you just made and BIT should auto start without any UAC prompts.
I use this in combination with running Blue Iris as a service and they both now start up reliably when my VM starts.
My inspiration for getting this to work was from:
How do I run a PowerShell script when the computer starts?
how to run a powershell script as administrator
I hope this helps someone.
Nick
I have been trying to find a way to start Blue Iris Tools automatically when my windows10 VM starts/restarts without disabling UAC prompts without much luck.
Although the program has a 'start when windows boots' option, it gets stuck on a UAC prompt waiting for someone to click yes or eventually times out and the program doesn't start.
Yesterday I finally found a way to do this and I thought I'd share for everyone else and my future self looking for how to do this in 2 years time lol.
This requires you to have an administrator account with a password set on your windows 10 machine / vm.
Step 1)
Install Blue Iris Tools as normal, in the default install location. After the install, do not select the 'Start when windows boots' tickbox. I've also selected 'Minimize to tray'
Step 2)
Go to Documents and create a new .txt file. Put the following text into the txt file:
Code:
# On UAC-enabled systems, to make sure a script is running with full admin privileges, add this code at the beginning of your script:
param([switch]$Elevated)
function Test-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ($elevated) {
# tried to elevate, did not work, aborting
} else {
Start-Process pwsh -Verb RunAs -ArgumentList ('-noprofile -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
}
}
'Running with full privileges'
& "C:\Program Files (x86)\Blue Iris Tools\Blue Iris Tools.exe"
exit
Step 3)
Save the file and rename it to BITools_startup_script.ps1
Step 4)
Go to start, type 'run' and in run type 'shell:startup'
This should take you to C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Alternatively just navigate to the path above if you don't want to use run
Step 5)
Create another .txt file and paste the following inside:
Code:
PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell %USERPROFILE%\Documents\BITools_startup_script.ps1" >> "%TEMP%\StartupLog.txt" 2>&1
Step 6)
Rename the .txt file to BIT_startup.cmd
That's it! BIT will now start as admin every time the windows 10 machine starts up, without actually needing to login.
You can confirm this works by simply double clicking the .cmd file you just made and BIT should auto start without any UAC prompts.
I use this in combination with running Blue Iris as a service and they both now start up reliably when my VM starts.
My inspiration for getting this to work was from:
How do I run a PowerShell script when the computer starts?
how to run a powershell script as administrator
I hope this helps someone.
Nick
Last edited: