Solved

Defrag as a service using instsrv srvany

Posted on 2003-10-29
15
403 Views
Last Modified: 2013-12-04
Has anyone out there set this up before?  I could use detailed instructions.  So far, I only have these links to go by:
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=7959
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=8148
http://support.microsoft.com/?kbid=231176
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q152/4/60.asp&NoWebContent=1
http://www.morphasys.com/autodefrag/

I'd like to be able to let end users in the local power users group on Windows XP Pro machines be able to run disk defrag whenever they want on their own.  However when I try set this up and try to run the service (even while logged in as local admin), I get the following error:

"The autodefrag service on Local Computer started and then stopped.  Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service."

Thanks in advance!

0
Comment
Question by:mb2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
15 Comments
 
LVL 32

Expert Comment

by:LucF
ID: 9648447
have you tried the -f switch on the defrag program, this forces defrag to run even if it thinks there isn't any work to do?

LucF
0
 

Author Comment

by:mb2010
ID: 9651177
The auto defrag program works on it's own, and yes it will work with the -f switch.  When I set the autodefrag program to run as a service is where I run into the problem.
0
 
LVL 32

Expert Comment

by:LucF
ID: 9651237
Can you find anything in the event-logs? If so please post all details.

LucF
0
Are You Headed to Black Hat USA 2017?

Getting ready for Black Hat next week? Kick things off with the WatchGuard Badge Challenge and test your puzzle and cipher skills. Do you have what it takes to earn our limited edition Firebox Badge? Get started today - https://crimsonthorn.net

 

Author Comment

by:mb2010
ID: 9653980
Nothing in the event logs that looks unusual.
0
 
LVL 32

Expert Comment

by:LucF
ID: 9654040
I'm at the moment trying to copy the thing you're trying todo, having the same problem, I'll let you know as soon as I find something.

LucF
0
 

Author Comment

by:mb2010
ID: 9654294
Okay.  Thanks.
0
 
LVL 1

Expert Comment

by:NetwerkMerc
ID: 9849804
This is a problem for many reasons:
1-As a service it is going to run all the time.  It will stay resident in memory and may even lock access to the disk at some point.  
2-You are going to run inot interrupt contention, usually logical disk manager will lock to provide partition or volume level access and it has priority (ie it can stop defrag or any other app that hooks int13) because basically it is those services that handles negotiation with the HAL from the system to hardware
3-Defrag doesn't register as system activity, power management COULD powerdown the system
4-IT RUNS ALL THE TIME, what good does a manual service setting do in this situation?

Use the command line option and make a scheduled task.  It will wake the computer and keep it from sleeping untill finished.  It can logon using a service account you create for it, domain or local.  Just give it appropriate rights.  

Since MS defrag doesn't defrag the MFT or the page file, once a system is defraged it will largely remain that way.  Only through installs and uninstalls does the system get fragmented.  No need to have a huge temp.inetfiles, most cached objects are small gifs 1-2k.  If its not huge it won't fragment the drive.

If you are looking for a decent defrag solution Diskeeper is the way to go.  www.executivesoftware.com

-Eric
Security and Virus forum moderator
<edited by YensidMod>
0
 
LVL 1

Expert Comment

by:NetwerkMerc
ID: 9849822
Per MS: http://support.microsoft.com/default.aspx?scid=kb;EN-US;314848
It can defragment only local volumes.
It can defragment only one volume at a time.
It cannot defragment one volume while it is scanning another.
It cannot be scheduled. If you need to schedule disk defragmentation, use the Defrag.exe command line tool. For additional information about using the command line Defrag.exe tool, click the following article number to view the article in the Microsoft Knowledge Base:
283080 Description of the New Command Line Defrag.exe Included with Windows XP

-Eric
Security and Virus forum moderator
<edited by YensidMod>
0
 
LVL 1

Expert Comment

by:NetwerkMerc
ID: 9849908
Better yet make a batchfile, set a sceduled task to run the batch file and redirect output to a text file for review. Just make a directory for the output files.
<snip>
start
%sysvol%:\%windir%\defrag.exe c: -fv > x:\directory\defragc.log
%sysvol%:\%windir%\defrag.exe d: -fv > x:\directory\defragd.log
%sysvol%:\%windir%\defrag.exe e: -fv > x:\directory\defrage.log
...
end
</endsnip>

-Eric
Security and Virus forum moderator
<edited by YensidMod>
0
 
LVL 1

Expert Comment

by:NetwerkMerc
ID: 10249806
Hello......close this topic please or reply!

-Eric
0
 

Author Comment

by:mb2010
ID: 10255280
Sure.  I understand what Microsoft says about this.  However, I was looking for an automated, hacked, way of doing it based on the links I provided.
0
 

Author Comment

by:mb2010
ID: 11399707
I never got a complete answer on this.  I have settled for creating a shortcut with the following entry in the Target:
%windir%\System32\runas.exe /user:adminusername@domainname.com "mmc dfrg.msc"

This way, I do not have to log off the end user to run defrag.  I just enter the admin password and have the app minimized until the user has time to run it.

Regards,

mb2010

Moderator, you a free to close this if you would like.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11424341
PAQed, with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

632 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