Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16093

executing a program that doesnt want to start

$
0
0
Windows 10 has removed the Windows Experience Index (WEI) interface that rates your computer, but the functionality is still there. Its a small console program in the system folder called WinSAT.exe that does the work.

I can easily start a cmd prompt or powershell and run the program with the arg 'formal' as in "winsat formal" and it does what it is supposed to do. So i thought to myself, self, write a small app to do this automatically, and capture the output.

Yea.... Windows apparently doesnt want me to run this program from another app. I have tried about a dozen different ways to start this program and most fail with not even being able to find the file.

The main condition being that I want to start the program without messing with WinSAT.exe permissions or attributes. I also would like to capture the output so i need the process handle in return (CreateProcess() is ideal).
My thinking is, if i can invoke the program as a administrative user, i should be able to run it from my VB app with proper elevation.

But alas, success alludes me... I want to challenge the good people of this forum to execute this app.

Some things I have tried:

1) manifest file with requestedExecutionLevel level="highestAvailable" and "asInvoker"

2) run my app compiled and as admin

3) command line prompts with powershell and Command Prompt

-powershell Start-Process -FilePath $env:comspec -ArgumentList winsat formal -Verb RunAs -WindowStyle Hidden
-powershell Start-Process -FilePath cmd -ArgumentList winsat formal -Verb RunAs -WindowStyle Hidden
-powershell Start-Process -FilePath powershell -ArgumentList winsat formal -Verb RunAs -WindowStyle Hidden
-runas winsat formal
-cmd /c winsat formal [runAs]

4) elevated vbscript (i can run it fine, vb no)

5) elevated powershell script

6) CreateProcess, ShellExecute, Shell


Can anyone get this thing to run from vb6?

Viewing all articles
Browse latest Browse all 16093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>