can't run diskpart.exe through c program or perl

Discussion in 'Windows Server' started by Angela, Jul 19, 2005.

  1. Angela

    Angela Guest

    On Windows 2003 enterprise 64-bit sp1 I cannot execute diskpart (or defrag)
    from either a c program or a perl script. In fact, neither perl, nor c can
    even find the file. For example, if I do an if (-e
    "$WINDIR/system32/diskpart.exe") perl doesn't find the file. I have also
    tried perl glob with the same result, as well as similar with c.

    I can execute diskpart from the windows command line.
    I have tried passing the entire path as well as just diskpart (works on
    32-bit version)
    I've checked the permissions and compared them to files that work (fc.exe).
    The permissions look the same.
    Until the same was reproduced with c I thought it was a problem with Perl.
    I installed 2003 enterprise 32 bit on the same system and it works fine.
    It works fine on XP 32-bit. Although I have not tried 64-bit XP yet.

    Need more info? Comments? Help? Help!
    Angela, Jul 19, 2005
    1. Advertisements

  2. Angela

    Angela Guest

    Also happens on XP 64-bit.
    Angela, Jul 19, 2005
    1. Advertisements

  3. Angela

    Angela Guest

    I think I have answered my own question and I thought others might want to
    know. This is what it looks like to me:

    There are now two folders that we need to be concerned with system32 and
    sysWoW64. It looks _to me_ that me that requests for the System32 directory
    get rerouted to the sysWoW64 directory, which contains a 32-bit copy of
    System32, the real System32 directory now has 64-bit files. The problem is,
    diskpart.exe (or defrag.exe) do not exist in the sysWoW64 directory. I
    further don't understand why MS would put the 64-bit apps in system32 and the
    32-bit apps in sysWoW64.... Maybe this is not true at all and just don't

    To make a long story longer, it looks like the Windows shell knows where it
    is, thus cmd line/batch works, but neither C nor Perl know, so they are
    re-routed to sysWoW64.

    While I don't like the work-around at all, it seems if you copy the missing
    commands from system32 to sysWoW64 the scripts and programs work.

    Thank you MS. I hope this gets fixed.
    Angela, Jul 19, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.