Extend your disk partition to max
-
[quote=“David Atkinson, post: 9134, member: 2696”]FWIW, I have a much shorter diskpart.txt file:
[CODE]select disk 0
select partition 2
extend[/CODE]I just call it from the SetupComplete.cmd script:
[CODE]@echo off
diskpart /s C:\Windows\Setup\Scripts\diskpart.txtdel /Q /F C:\Windows\System32\Sysprep\unattend.xml
del /Q /F C:\Windows\Panther\unattend.xml
del /Q /F C:\Windows\Setup\Scripts\diskpart.txtsc config “Sophos AutoUpdate Service” start= auto
sc config “Sophos Agent” start= auto
sc config “Sophos Message Router” start= auto[/CODE]But, of course, I’m blessed with very consistent, almost homogeneous hardware.[/quote]
Whoa this is all interesting what image types are you using for the master image and your deployment image?
-
[quote=“astrouga, post: 8537, member: 907”]Since I use “one image to rule them all”, I have to remember to shrink my partition down below the smallest disk in inventory before I sysprep it. Otherwise the image will fail on some systems. I have some disks that are 80GB and some that are 500GB. So I usually manually shrink my disk down below 80GB before I sysprep it. Then after imaging a system with larger disks, I have to extend the partition to the max size. I got tired of doing this manually, so I wrote a vbscript to do this for me. I’m sharing it in hopes that it helps others, but also to see if anyone has a better way.
I actually use this snippet of code in a larger vbscript that does other things (local account creation, firewall exceptions, registry changes, printer installs, etc), but I’ve pulled out necessary the code below. Should be complete. Note it is actually two files. One is the vbscript that just runs diskpart, the other is a text file that contains the options to pass to diskpart.
[B][U]extend_max.vbs[/U][/B]:
[CODE]’ ########## Extend Disk Partition (MAX) ##########
LogFilename = “C:\Windows\Setup\InstallLog.txt”
LogFile.writeline “-------------------------------”
LogFile.writeline “Extending partition to max size:”
LogFile.writeline “-------------------------------” & VbCrlfdiskpartScript = “C:\Windows\Setup\Scripts\extend_max.txt”
Set oShell = CreateObject(“Wscript.Shell”)
Set oShellExec = oShell.Exec("cmd /c diskpart -s " & diskpartScript)
set oStdOutputText = oShellExec.StdOutDo While Not oStdOutputText.AtEndOfStream
diskpartOutput = oStdOutputText.ReadLine
LogFile.writeline diskpartOutput
Loop[/CODE][B][U]extend_max.txt[/U][/B]:
[CODE]select disk 0
detail disk
list disk
select volume c
extend disk 0
list disk
exit[/CODE]I call this script by adding a line to my SetupComplete.vbs script. Something like:
REG ADD %KEY%\005 /VE /D “Extending disk partition size to max” /f
REG ADD %KEY%\005 /V 1 /D “%systemroot%\Setup\Scripts\extend_max.vbs” /fastrouga[/quote]
I modified my image to include this and it seems work on those pesky advance format drives
-
I am having hard time implementing this tutor on Windows 7 ent…
I trying to make it part of the image and follow steps from astrouga and no successadded this to the script
REG ADD %KEY%\005 /VE /D “Extending disk partition size to max” /f
REG ADD %KEY%\005 /V 1 /D “%systemroot%\Setup\Scripts\extend_max.vbs” /fadded exactly the same but got error on the command prompt
-
[quote=“golpemortal, post: 9246, member: 2653”]I am having hard time implementing this tutor on Windows 7 ent…
I trying to make it part of the image and follow steps from astrouga and no successadded this to the script
REG ADD %KEY%\005 /VE /D “Extending disk partition size to max” /f
REG ADD %KEY%\005 /V 1 /D “%systemroot%\Setup\Scripts\extend_max.vbs” /fadded exactly the same but got error on the command prompt[/quote]
What error did you get?
-
Dealman can you give me a steps by steps on implenting this tutoral from A to Z.
the error message that I got was when I ran the setupcomplete.cmd on the command prompt and was complanning about REG ADD format…could it been that I was not doing it right , since this is my first time messing with fog cloning I would like some help…
-
[quote=“golpemortal, post: 9293, member: 2653”]Dealman can you give me a steps by steps on implenting this tutoral from A to Z.
the error message that I got was when I ran the setupcomplete.cmd on the command prompt and was complanning about REG ADD format…could it been that I was not doing it right , since this is my first time messing with fog cloning I would like some help…[/quote]
I didn’t do the whole reg add part. i called the disk part from SetupComplete.cmd script like what David suggested
-
ok can you point me out to a good tutorial… this one here is a bit complicated for newbee like me
-
[quote=“golpemortal, post: 9308, member: 2653”]ok can you point me out to a good tutorial… this one here is a bit complicated for newbee like me[/quote]
I dont believe a guide exists but
Go into the c:\Windows\Setup\Scripts folder (if you dont see a scripts folder then make one) in the scripts folder you should have 2 files to make this work. You need a diskpart.txt file that has the code below in it
select disk 0
select partition 2
extendthen in the SetupComplete.cmd file add this
diskpart /s C:\Windows\Setup\Scripts\diskpart.txt
del /Q /F C:\Windows\Setup\Scripts\diskpart.txtmake any other changes that you need to then sysprep and upload your image. When you go to deploy
it should work.that’s all you need to make this work
-
thanks I will try this Monday morning I post results
-
EDIT: Haha. Well after long last I managed to get the script to work with just a few clicks and no errors. Thanks anyways, and thank you astrouga. (if you still visit here)
I know this is an old post, but I was using astrouga’s Script and it works great, however, I get a Error: Object Required “Log Script”
It says it’s on the last line character 1
The script actually runs all of the way through and extends the hard drive, but I am very very new to scripting ( like maybe a week ago I started ) and was wondering if this would ever be a problem.
Thanks!