[Solved] RunProgram fails as admin
Posted: Sat Jun 08, 2019 8:05 am
Solved! I noticed that when I was logged in as admin, my default apps were set to something called "TWINUI". So I googled that, and found this thread:
https://superuser.com/questions/1150365 ... ith-twinui
A little down the page of that link, was a PowerShell script to "reset" the apps to their Win 10 defaults:
https://github.com/WillBixler/TwinUI-Fix
So I downloaded the script and ran it (hoping it wasn't malicious!) and it removed the "TWINUI" defaults and put them back to the correct Win 10 defaults. From there, I was able to change those defaults back to IrfanView (for images) and Media Player Classic (for MP4s).
The end result: my app now runs (opens) the files correctly when run as admin!
Original post:
Got a weird one for you. The following line fails to open a JPG image when my exe is run with admin rights, but opens it normally when run with limited rights. What the hell? What could be causing it to fail with admin rights? The result of RunProgram() is 1, so the command "worked", but no image is opened. I tried disabling my anti-virus (Windows Defender) but it didn't make any difference.
[Edit] I even got this Windows message when trying to run it as admin, so it has to be some sort of permission thing? My program works fine on another PC. Wish I knew why one PC has the issue, though. How can I expect my customers to deal with a problem like this?
https://superuser.com/questions/1150365 ... ith-twinui
A little down the page of that link, was a PowerShell script to "reset" the apps to their Win 10 defaults:
https://github.com/WillBixler/TwinUI-Fix
So I downloaded the script and ran it (hoping it wasn't malicious!) and it removed the "TWINUI" defaults and put them back to the correct Win 10 defaults. From there, I was able to change those defaults back to IrfanView (for images) and Media Player Classic (for MP4s).
The end result: my app now runs (opens) the files correctly when run as admin!
Original post:
Got a weird one for you. The following line fails to open a JPG image when my exe is run with admin rights, but opens it normally when run with limited rights. What the hell? What could be causing it to fail with admin rights? The result of RunProgram() is 1, so the command "worked", but no image is opened. I tried disabling my anti-virus (Windows Defender) but it didn't make any difference.
Code: Select all
param$=""
file$="c:\temp\image.jpg"
RunProgram(file$,param$,GetPathPart(file$))