Skip to content

Use diskpart in script mode to circumvent problems when not running as admin#12

Open
R0Wi wants to merge 1 commit into
mikemaccana:mainfrom
R0Wi:fix-admin-permissions
Open

Use diskpart in script mode to circumvent problems when not running as admin#12
R0Wi wants to merge 1 commit into
mikemaccana:mainfrom
R0Wi:fix-admin-permissions

Conversation

@R0Wi

@R0Wi R0Wi commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

Problem

Currently when running the script as non-admin user, the invokation of diskpart shows the Windows UAC dialog where we can input the admin user credentials for elevating the process, but piping diskpart commands to that process does not work. The diskpart commandline windows stays open and does nothing.

How to reproduce

  1. Run the script as non admin user so that is pics up all disks from that user
  2. Observe that on the diskpart line a new credentials window will pop up
  3. Provide local admin credentials, so that diskpart window can be opened
  4. Diskpart commands are not executed

Solution

Using script mode instead solves this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant