Jump to content
Sign in to follow this  
SiMonsterrr

DISKPART in WinPE not working

Recommended Posts

SiMonsterrr

Hello everybody

First time using AutoIT for me, so please have mercy :D
I am using AHK in my WinPE environment and I want to accomplish the following:

I have one disk drive with 2 partitions:
Partition 1 - C 
Partition 2 - D

Now Partition 1 is my UEFI Partition and I want to change the drive letters, that Partition 2 (my Windows partition) uses the drive letter C.
I do this as following:

FileInstall("diskpart\diskpart.txt", @TempDir & "\diskpart.txt", 1) 
SplashTextOn("Windows 10 Migration Tool", "Systemdir is " & @SystemDir & "diskpart.exe", 800, 80, -1, 20)
RunWait("diskpart.exe /s " & @TempDir & "\diskpart.txt") 

This is my diskpart.txt:

sel disk 0
sel par 1
assign letter=f
sel par 2
assign letter=c
exit

diskpart.txt gets copied to the correct location, but the execution somehow doesn't work. If I look at the disk afterwards, everything's still the same. 
If I open up a CMD and execute "diskpart.exe /s X:\Windows\Temp\diskpart.txt", everything works perfectly. Also, the variables @TempDir has the correct value. 
What am I doing wrong?

Share this post


Link to post
Share on other sites
gillesg

Add the full path to diskpart.exe

 

Share this post


Link to post
Share on other sites
iamtheky

whats the command window say if you ("cmd /k diskpart.exe /s ....)?


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
SiMonsterrr
Just now, gillesg said:

Add the full path to diskpart.exe

 

I tried before with 

RunWait(@SystemDir & "\diskpart.exe /s " & @TempDir & "\diskpart.txt") 

it didn't make a difference.

Share this post


Link to post
Share on other sites
gillesg

I tested it on my side.

to see what happens use @ComSpec & " /k " & @Systemdir

RunWait(@ComSpec & " /k " & @SystemDir &"\diskpart.exe /s " & "d:\users\gigros\Downloads\dkpart.txt" )

 

Share this post


Link to post
Share on other sites
iamtheky
Posted (edited)

i am going to be mildly amused if you get a response from the OP, seeing as he is now sandwiched by the recommendation. 

specualtion:  I imagine it revealed the issue 3 days ago and is fixed. new members rarely feel the need to wrap the thread up in a pretty bow to allow others to learn as well. A common false belief among people new to the forum is that a (novice/syntax/new language) problem would display weakness rather than growth. 

 

Edited by iamtheky
clarity

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×