sayyed.ali1981 Posted March 1, 2011 Posted March 1, 2011 (edited) Hi guys,finally got the diskpart to work with cmd with full automated funcnality still in progress, almost 75% codeing has been done,check out the final.txt and comment on it for further editing.@ECHO OFFCOLOR 9A:beginCLSECHO. ECHO Welcome to Diskpart Which will create partition automaticaly ECHO Warning it will wipe your data completelyECHO If selected wrong disk be carefull while selectingECHO offecho>list.txtecho>list.txt list disk@echo offdiskpart -s list.txt@echo offSET /P disk= Choose a disk: if ‘%disk%’ == ‘5’ goto 5 if ‘%disk%’ == ‘4’ goto 4 if ‘%disk%’ == ‘3’ goto 3 if ‘%disk%’ == ‘2’ goto 2 if ‘%disk%’ == ‘1’ goto 1 if ‘%disk%’ == ‘0’ goto 0goto error :error echo. echo The disk letter you entered was not recognized echo. pause goto begin:0echo:echo>select.txtecho>select.txt select disk 0@echo offdiskpart -s select.txtecho. echo Would you like to Create a new partition.echo. echo Type C for Create partition or wanna edit volume echo Type E to see the volumeSET /P ok= Choose a option: if ‘%ok%’ == ‘c’ goto yes if ‘%ok%’ == ‘C’ goto yes if ‘%ok%’ == ‘e’ goto no if ‘%ok%’ == ‘E’ goto no goto error :error echo. echo The letter you entered was not recognized echo. pause goto begin :no echo. echo Select volume echo be carefull will selectingecho. echo>volume.txtecho>volume.txt list volume@echo offdiskpart -s volume.txtecho offset INPUT= set /P INPUT=Type input: %=%echo Your input was: %INPUT%pauseecho select volume=%INPUT% >>selectvolume.txtdiskpart -s selectvolume.txt:yesecho:echo>active.txtecho>active.txt active@echo offdiskpart -s active.txtecho. echo Put size u want for partition.example size in 1024 mb echo The size will be in MB not GBecho. echo offset INPUT= set /P INPUT=Type input: %=%echo Your input was: %INPUT%pauseecho CREATE PARTITION Primary Size=%INPUT% >>create part.txtgoto error :error echo. echo The disk letter you entered was not recognized echo. pause goto begin:endecho Thank you for using this toolDel /f "list.txt"Del /f "volume.txt"Del /f "select.txt"pauseexitfinal.txt Edited March 3, 2011 by sayyed.ali1981
diskpart1234 Posted September 19, 2011 Posted September 19, 2011 wow man, looks awesome.I was writing similas thing myself....though i got to the part where user selects diks and gets message that disk X is selceted.I cant incorporate "clean" command afterwards.I ant user to get Questio anfter choosing disk if disk needs to be cleaned but I dont kn ow...can t make it work.Any Ideas???
jaclaz Posted September 20, 2011 Posted September 20, 2011 I haven't even checked the posted code, but there is a trick to embed diskpart commands inside a batch, check this thread here:jaclaz
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now