Old 6th August 2011, 11:16   #1
Junior Member
Join Date: May 2009
Posts: 16
Defrag from NSIS


I am trying to use the Microsoft disk defragmenter in an NSIS script i am working on, but even in this simple example It does not work. It just does not seem to launch the defrag executable.

I am sure the command itself is correct as the exact command works from a batch file.
I have also tried exec, execwait, nsexec::exec with no luck.
I am using Windows 7 64 bit.

Here is the example:

Name "defrag"
OutFile "defrag.exe"
RequestExecutionLevel Admin
InstallDir "$TEMP\"
XPStyle on
page instfiles

Section ""

execwait '"c:\windows\system32\chkdsk" C:' #This works
execwait '"c:\windows\system32\defrag.exe" C:\' #This does not


Many thanks

fixed, i had to include x64.nsh then ${DisableX64FSRedirection}.
dougcvc is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump