Click here to Skip to main content
14,268,822 members
Rate this:
Please Sign up or sign in to vote.
See more:
i need run command
hDevice := CreateFile( '\\.\PhysicalDrive0:', GENERIC_READ or GENERIC_WRITE ,
        FILE_SHARE_READ or FILE_SHARE_WRITE , nil, OPEN_EXISTING, 0, 0 );

in the application as a standard user.this command run the application as a administrator.

What I have tried:

i need run command <pre>hDevice := CreateFile( '\\.\PhysicalDrive0:', GENERIC_READ or GENERIC_WRITE ,
        FILE_SHARE_READ or FILE_SHARE_WRITE , nil, OPEN_EXISTING, 0, 0 );

in the application as a standard user.this command run the application as a administrator.
Posted
Updated 1-Jun-19 4:09am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You can't. Access to the "physical" drive requires admin privileges or an account that has the SeBackupPrivilege, which normal user accounts do not have.

Why? Because access to the physical drive is a massive security risk. This about the stupidity of your every day user and then add malicious software, a.k.a: viruses, to that mix.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100