teligence

New Member
Joined
Oct 30, 2011
Messages
2
Running a clean installation of Windows 7 Home Premium, 64-bit, fully updated.

I'm writing a document that I would like to include a hyperlink to a shortcut or batch file that the reader (my daughter) can simply click on and it will run chkdsk via batch file in a command prompt.

When I run it I get the following response:

"Access Denied as you do not have sufficient privileges.
You have to invoke this utility running in elevated mode."

It works fine if I disable UAC, but I would prefer to leave that level of security in place.

When using "runas" and an admin account referenced in the command line, I receve a prompt for the pasword as expected, enter it, receive a command bos message that states that it's trying to start chkdsk as the admin user I referenced. Anothe box flashes up for an instant - too quick to see anything but the flash - then disappears and I. back at the starting command prompt.

How do I run chkdsk from a user-level command prompt?
 


Solution
To run chkdsk from a user-level command prompt in Windows 7 while keeping UAC enabled, you need to elevate the command prompt itself before running the chkdsk command. Here's how you can do this: 1. Run Command Prompt with Elevated Privileges: - Click on the Start button and type "cmd" in the search bar. - Right-click on "cmd" or "Command Prompt" in the search results. - Select "Run as administrator." This will open an elevated Command Prompt window. 2. Running chkdsk in the Elevated Command Prompt: - In the elevated Command Prompt window, you can now run the chkdsk command. - Type chkdsk followed by the drive letter you want to check and the necessary parameters. - For example, to check the...
To run chkdsk from a user-level command prompt in Windows 7 while keeping UAC enabled, you need to elevate the command prompt itself before running the chkdsk command. Here's how you can do this: 1. Run Command Prompt with Elevated Privileges: - Click on the Start button and type "cmd" in the search bar. - Right-click on "cmd" or "Command Prompt" in the search results. - Select "Run as administrator." This will open an elevated Command Prompt window. 2. Running chkdsk in the Elevated Command Prompt: - In the elevated Command Prompt window, you can now run the chkdsk command. - Type chkdsk followed by the drive letter you want to check and the necessary parameters. - For example, to check the C: drive with a repair switch, you would type: chkdsk C: /F 3. Creating a Shortcut: - To create a clickable shortcut for your daughter, you can create a shortcut to the Command Prompt that automatically runs as an administrator. - Right-click on the desktop and select New > Shortcut. - In the location field, type cmd.exe. - Click Next, give the shortcut a name, and click Finish. - Right-click on the newly created shortcut and select Properties. - In the Properties window, go to the Shortcut tab. - Click on the Advanced button. - Check the box that says "Run as administrator" and click OK. - Now, whenever your daughter double-clicks on this shortcut, an elevated Command Prompt window will open, and she can run chkdsk commands without any permission issues. By following these steps, you should be able to run chkdsk from a user-level command prompt with the necessary privileges and without disabling the UAC (User Account Control).
 


Solution
Back
Top