Avatar of arunykand
arunykandFlag for United States of America asked on

diskpart output

I'm trying to get the 'uniqueid' of my disk via diskpart and get that output to a text file, and i'm running into an issue.  I'm able to use 'diskpart' and view the uniqueid, but when I try to pipe the output to a text file, the file get's created but it's empty.

I'm running this on Win-7 x64;

Here the command I run:
diskpart /s c:\test\disk.txt > diskid.txt

The file disk.txt contains these commands to run in diskpart:
select disk 0
uniqueid disk

diskid.txt get's created, but is empty.

Any help?  Thank you!
Microsoft Legacy OSWindows OSWindows 7

Avatar of undefined
Last Comment
Joe Winograd

8/22/2022 - Mon
Joe Winograd

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Joe Winograd

Hi arunykand,
Have you tried running the command prompt as administrator yet? I'm confident that will solve the problem for you, as I was able to replicate your exact problem here, i.e., the file is empty when the command prompt is run normally, but the file has the correct output when the command prompt is run as administrator (known as an "elevated" command prompt). Regards, Joe

I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Joe Winograd

There is definitely enough information to confirm an answer. I am 100% confident that http:#a39669909 is the answer. The problem is 100% reproducible. The file is empty when the command prompt is run normally, but the file has the correct output when the command prompt is "Run as administrator" (also known as an "elevated" command prompt). I'm certain that anyone reviewing this thread will have the same results. And any EE member with the same problem would be well-served to find this solution. Regards, Joe
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.

Yes, this did work....Sorry for the hold-up, fell through the cracks, but certainly appreciate the help!
Joe Winograd

OK, great to hear! Thanks for letting us know that it works for you. Regards, Joe