Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning a letter to a disk without any notification #2644

Closed
lailaa19 opened this issue Dec 22, 2024 · 1 comment
Closed

Assigning a letter to a disk without any notification #2644

lailaa19 opened this issue Dec 22, 2024 · 1 comment

Comments

@lailaa19
Copy link

lailaa19 commented Dec 22, 2024

Hello pbatard, I'm working on a software to create virtual disks, i have been able to apply the windows image on the disk and customize everything using its volume guid, the final step is assign a letter, however, whenever a letter is assigned it shows a shell notification, i'm trying to find a way to avoid this, i mean, a "silently" way to assign the disk a letter.

While searching around i found this part of the code, but i didnt understand what DefineDosDeviceA really does, and if it could help on this case.

// bcdboot doesn't like it if you forget the starting ''

rufus/src/drive.c

Line 2174 in 1e2f1c1

if (!DefineDosDeviceA(DDD_RAW_TARGET_PATH | DDD_NO_BROADCAST_SYSTEM, mounted_drive, &volume_name[14])) {

Also, in relation to bcdboot I have tried multiple ways to get it to work with a unc path like:

1. bcdboot G:\ /s Volume{d2a1742f-a81e-4740-ba78-c0ff34898478}
2. bcdboot \PhysicalDrive3\Windows /s Volume{d2a1742f-a81e-4740-ba78-c0ff34898478}
3. bcdboot \\?\Volume{ec668c78-a652-4056-862e-6e1a29dafe27}\  /s Volume{d2a1742f-a81e-4740-ba78-c0ff34898478}
4. bcdboot Volume{ec668c78-a652-4056-862e-6e1a29dafe27}  /s Volume{d2a1742f-a81e-4740-ba78-c0ff34898478}

Where d2a1742f... is the system partition and ec668... the Windows folder gpt partition.
Only 1. works all other attempts fail with:

Failure when attempting to copy boot files.

I posted a detailed question with all my attempts on the microsoft Q&A forum, I wonder if you could take a look at it, also, if possible, this related question.

@pbatard
Copy link
Owner

pbatard commented Jan 3, 2025

I'm not sure I completely understand what your issue is, but I think it is tied with autorun, and you therefore might have to perform the same dance Rufus performs, which is to use Local Group Policies to temporarily disable autorun (look up NoDriveTypeAutorun) per https://github.com/pbatard/rufus/blob/master/src/rufus.c#L3676-L3678, so that Windows won't pop up a dialog when it sees a new drive has been created.

But apart from that, sorry, I just don't really have the scope to look into your specific problem. Good luck with your software project though.

@pbatard pbatard closed this as completed Jan 3, 2025
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

No branches or pull requests

2 participants