Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900