how to create partitions using a % of drive from 32 bit enviroment (scripting)

Posted on 2006-05-30
Last Modified: 2010-04-03
I am trying to write a script to partiton and format a drive into two equal parts in a windows xp preinstall enviroment (32 bit)  It rules out fdisk and diskpart doesn't take % of the drive.
Question by:rkremser

    Expert Comment

    I don't know how to write the script, but there are several programs out there that do this for you. The one that I have found works best is Norton PartitionMagic (

    Author Comment

    humm, I really am looking specifically for a program that I can script into another setup, thanks anyone else?
    LVL 3

    Expert Comment

    Check out these three links seems to be pretty nice.

    This is kinda cheezy but you can build on this script I made:
    @echo off && cls && color 0a
    echo Coded by Syn4k on AIM
    for /l %%i in (1, 1, 5) do echo.
    echo Starting Partition Manager...
    set /p drive="Enter drive letter: "
    set /p size="Enter total size of drive to split [in MB]: "
    set /a size=%size%/2
    format %drive% /fs:NTFS /q /x /a:%size%

    Just name it something like formatt.cmd when saving it.

    Author Comment

    ok i worked around it with diskpart in the win 2k preinstall enviroment here is the script i used.....

    diskpart /s scr.txt
    echo                           /\
    echo "                         ||
    echo "
    set /p size=Enter half disk size in MB:
    copy r:\temp\new.txt r:\temp\scr2.txt
    echo create partition primary size=%size%>>r:\temp\scr2.txt
    echo active>>r:\temp\scr2.txt
    echo create partition extended>>r:\temp\scr2.txt
    echo create partition logical>>r:\temp\scr2.txt
    echo assign letter==t>>r:\temp\scr2.txt
    diskpart /s r:\temp\scr2.txt
    del r:\temp\scr2.txt
    format t: /v: /FS:NTFS /Q /Y

    select disk=0
    list disk

    select disk=0

    Accepted Solution

    Closed, 50 points refunded.
    Community Support Moderator
    replacement part #xm34

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A bootable USB key can be very handy now-a-days. My favorite USB key consists of our Windows 7 image, network card drivers (to connect up to a Ghost server), the latest BIOS updates for all of our PCs and CopyWipe (to erase a retired PC) Creating…
    How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
    This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
    This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now