Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts



Execute Defrag Remotely

Post image for Execute Defrag Remotely

by Steve Wiseman on December 13, 2013 · 5 comments

in Network Administrator,Network Administrator Updates


This week Tim asked:

“How do I run Defrag remotely using Network Administrator?”

This is a good question. Normally you can execute any batch file, or script you want just using the remote execute plugin.

Defrag.exe, and other tools built into Windows are different. Since the file is located under c:\windows\system32, Windows will try to be smart and redirect 32 bit apps to a 32 bit version

Network Administrator uses a 32 bit service to execute, and this in turn causes a call to defrag to fail when trying to execute it remotely…since there is no 32 bit version of it on 64 bit windows.

We did find a trick to get around it. On Windows 7 and higher, there is a hidden environment variable named %sysnative% that will allow you to call the 64 bit version of any windows tool from a 32 bit exe.

Using our new found knowledge, we built a plugin that allows you to run defrag remotely, and across many machines at a time.

You can just analyze:

Network Administrator Analyze

Run a full defrag, or run defrag without waiting:

Network Administrator Defrag Options

If you forgot that you were running a defragmentation, it won’t let you run it more than once:

Duplicate Defrag

If you wait for the results, it will show you the output:

Defrag Analyze

Get your copy of Network Administrator from here:

Network Administrator Download

For Network Administrator to do its work, it needs file and printer sharing open. Microsoft has disabled this by default.

These articles will walk you through enabling it:

Windows XP:

Windows Vista, 2008:

Windows 7, 2008 R2:

Windows 8, 2012:

From a script on any version of windows (Must run as administrator):

Enable the admin share from a script

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 5 comments… read them below or add one }

1 Tracy December 13, 2013 at 12:59 pm

Hi Steve,

We have a bunch of old Windows XP machines that desperately need to be defraged. Will this work on Windows XP machines?


2 Steve Wiseman December 13, 2013 at 1:00 pm

Hi Tracy,

Yes, we have tested it under Windows XP, and it works without issues.

3 Bob Cruze December 13, 2013 at 1:01 pm

Any chance this will work under Windows 2000? I have a call manager server from cisco, and it would be great if I could defrag it remotely.

4 Steve Wiseman December 13, 2013 at 1:02 pm

Hi Bob,

We have not tested it under Windows 2000, but I think it should work fine. I believe defrag had the same command line options in 2000.

5 Nathan December 13, 2013 at 1:02 pm

Just want to say thanks for the plugin updates steve. This tool has been great.

Leave a Comment

Category Links - Windows Forum - Exchange Forum