earlephilhower / ezfio

Simple NVME/SAS/SATA SSD test framework for Linux and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running as Admin Calls Wrong Path

coolrecep opened this issue · comments

Hi,

when you right click the batch file and run it as admin, PowerShell script is not called from the current path but rahter called from C:\Windows\System32. And this lead to nothing, as the script is not there.

I was unable to run ezFIO and was wondering what was the problem. Finally, after removing the hidden attribute from the batch file and recoding the screen, I was able to capture this:

image

I have copied all the files into System32 and it was working just fine after that moment.

OS: Windows 10 Build 1607

I've not tried on Win10, but I think the problem is actually one of usage here. The .BAT file actually does a runas Administrator on the .PS1 file in the PWD, so you shouldn't do "run-as-admin" from the Explorer shell. That's actually all the BAT file does.

I don't have W10 (this is really more for server OSs, so I run on WinServer 2K12 and 16), but I think all should be well if you just normal run the BAT file w/o the files in the %WINDIR% path. You can alternatively run-as-admin from Explorer on the actual PS1 (assuming W10 lets you run PS1, not sure what MSFT has as its default setting now).

No, running with normal privileges is not possible. CMD gives an error. I will post it here tomorrow.

Here it is, nothing happens:

image

Ah, looks like on consumer OSes the powershell execution policy may be not the same as server releases. Easy way to test is start a administrator powershell/cmd, CD into the ezfio dir, then do a "powershell .\ezfio.ps1" to execute it. My guess is you'll get a warning about Script Execution Policy and it won't do anything (and the above command will start an invisible window so you won't ever see the error).

Easiest thing on Win10 then may be to just run "Set-ExecutionPolicy -ExecutionPolicy Unrestricted" from an admin powershell prompt. Then retry that powershell .\ezfio (or run the .BAT file).

First method result:
image

Second worked:

image

I think this was related to the space in your path as opposed to permissions. Can you re-try with the latest checkin and see if the .BAT can start an admin Powershell to run the GUI?

Thx
-EFP3

Closing due to inactivity. If this appears again, please let me know. Thanks! -EFP3