PC Review


Reply
Thread Tools Rate Thread

defrag by clicking on shortcut, how?

 
 
Joel
Guest
Posts: n/a
 
      28th Feb 2007
%windir%\system32\defrag.exe C:\ -f

I have this in the target line of a shortcut on my desktop, but when I run
it, it seems to only give me the status. I want to be able to click just one
time on a shortcut or bat file on my desktop to defrag my C drive. Isn't
there someway to do this?

Thanks.



 
Reply With Quote
 
 
 
 
Gordon
Guest
Posts: n/a
 
      28th Feb 2007
"Joel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> %windir%\system32\defrag.exe C:\ -f
>
> I have this in the target line of a shortcut on my desktop, but when I run
> it, it seems to only give me the status. I want to be able to click just
> one time on a shortcut or bat file on my desktop to defrag my C drive.
> Isn't there someway to do this?
>
> Thanks.
>
>
>


And you don't analyse the disk first, to see if it actually NEEDS
defragging? XP needs defragging very much less than the W9x versions,
particularly if your disk is formatted in NTFS....


 
Reply With Quote
 
Ramesh, MS-MVP
Guest
Posts: n/a
 
      28th Feb 2007
The shortcut and the parameters are correct. When you run the shortcut, it defragments the drive, and provides you with a report similar to this:

- - -
C:\Documents and Settings\Ramesh>defrag c:\ -f
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International, Inc.

Analysis Report
3.90 GB Total, 3.21 GB (82%) Free, 0% Fragmented (0% file fragmentation)

Defragmentation Report
3.90 GB Total, 3.21 GB (82%) Free, 0% Fragmented (0% file fragmentation)
- - -

Because you're the console utility from a shortcut, the Command window closes immediately before you can read the output. The job, however, is done correctly. To be sure, open a Command Prompt window and type:

defrag c: -f

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
Windows® Troubleshooting http://www.winhelponline.com


"Joel" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
%windir%\system32\defrag.exe C:\ -f

I have this in the target line of a shortcut on my desktop, but when I run
it, it seems to only give me the status. I want to be able to click just one
time on a shortcut or bat file on my desktop to defrag my C drive. Isn't
there someway to do this?

Thanks.



 
Reply With Quote
 
seth
Guest
Posts: n/a
 
      28th Feb 2007
or you could add an addition line in the batch file with the pause command
so you can see the output before the window closes


"Ramesh, MS-MVP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
The shortcut and the parameters are correct. When you run the shortcut, it
defragments the drive, and provides you with a report similar to this:

- - -
C:\Documents and Settings\Ramesh>defrag c:\ -f
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International,
Inc.

Analysis Report
3.90 GB Total, 3.21 GB (82%) Free, 0% Fragmented (0% file
fragmentation)

Defragmentation Report
3.90 GB Total, 3.21 GB (82%) Free, 0% Fragmented (0% file
fragmentation)
- - -

Because you're the console utility from a shortcut, the Command window
closes immediately before you can read the output. The job, however, is done
correctly. To be sure, open a Command Prompt window and type:

defrag c: -f

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
Windows® Troubleshooting http://www.winhelponline.com


"Joel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
%windir%\system32\defrag.exe C:\ -f

I have this in the target line of a shortcut on my desktop, but when I run
it, it seems to only give me the status. I want to be able to click just one
time on a shortcut or bat file on my desktop to defrag my C drive. Isn't
there someway to do this?

Thanks.




 
Reply With Quote
 
Ayush
Guest
Posts: n/a
 
      28th Feb 2007
Replied to [Ramesh, MS-MVP]s message :
> Because you're the console utility from a shortcut, the Command window closes immediately before you can read the output. The job, however, is done correctly. To be sure, open a Command Prompt window and type:


> defrag c: -f


Or change the target of shortcut to :
cmd /k defrag c: -f

Good Luck, Ayush.
--
Google Groups: http://groups.google.com/
 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      28th Feb 2007
Thank you all for replying. Ayush, what does your version do differently
from mine. I did not let it finish, but first impression is that it does the
same thing........

cmd /k defrag c: -f



 
Reply With Quote
 
Ayush
Guest
Posts: n/a
 
      1st Mar 2007
Joel wrote ::
> Thank you all for replying. Ayush, what does your version do differently
> from mine. I did not let it finish, but first impression is that it does the
> same thing........
>
> cmd /k defrag c: -f


cmd /? :
/K Carries out the command specified by string but remains.

In this case, the string is [defrag c: -f] so when you run [cmd /k defrag
c: -f], the command prompt window runs the string and remains.




Good Luck, Ayush.
--
Google Groups: http://groups.google.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
defrag. shortcut lost =?Utf-8?B?ZnJhbmt0ZWU=?= Windows XP General 8 27th Sep 2007 06:21 PM
defrag by clicking on shortcut, how? Joel Windows XP Customization 6 1st Mar 2007 12:02 AM
Right-clicking on desktop shortcut, any shortcut leads to long pause, sometimes lockup RE Windows XP General 3 3rd Jun 2006 12:41 AM
Defrag program opens but no response to clicking on buttons =?Utf-8?B?UGhpbA==?= Windows XP Performance 2 20th May 2006 04:50 PM
defrag shortcut bill18 Windows XP Performance 5 8th Jan 2004 05:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:57 PM.