Is there a way to kick off defrag across the network by passing cridentials with the command.
i.e. defrag -optional switches \\computername -username -password
Printable View
Is there a way to kick off defrag across the network by passing cridentials with the command.
i.e. defrag -optional switches \\computername -username -password
I know there's a way to do it, but I cannot think of it. You could always just disable defrag all together on the computers, restricting it to someone with Admin access.
You can't on XP/2000 because it runs from the msc and you can't pass switches to it.
You can use the program Autodefrag found here and schedule the task as posted here:
-Maestr0Quote:
Originally posted here by Maestr0
The simplest way to do this (using NetBIOS) is to open the remote machine and schedule a task by opening the Scheduled Tasks folder (you must have remote registry enabled for this). The other simplest way is to use the 'psexec' tool from sysinternals or something similar.
http://www.sysinternals.com/ntw2k/freeware/psexec.shtml
Maestro: How? As I posted before this implies it can't be done... I'm familiar with psexec bit all it's going to give me is a command line and my only option there is dfrg.msc.... I can't pass command line switches to it so what is your solution? 'Cos I'd like to use it on a few machines.... Does it work on XP?
I've got a windows XP Pro box here. and I just opened up my command prompt and typed defrag and got output.. It sure looks like a console-based app to me
I typed defrag c: and sure enough it started defragging my C drive..Quote:
C:\Documents and Settings\Administrator>defrag
Windows Disk Defragmenter
Copyright (c) 2001 Microsoft Corp. and Executive Software International, Inc.
Usage:
defrag <volume> [-a] [-f] [-v] [-?]
volume drive letter or mount point (d: or d:\vol\mountpoint)
-a Analyze only
-f Force defragmentation even if free space is low
-v Verbose output
-? Display this help text
Ahhh.... So 2000 is the "poor man's" XP.... 'Cos all I get under 2000 is the console... even with a "/?" after the "dfrg.msc"......
Who'da guessed that M$ would have done a double switch on us..... ;) So now the question is, is it worth buying the upgrades for this functionality..... I have to admit that I don't think so..... NTFS seems to do a much better job than FAT did when it comes to organizing itself so that massive fragmentation takes months or more rather than hours like it used to under "sunny old" FAT.....
Psexec \\computername -u username -p password defrag c: -v -a -f
Totally workds dude. Users do not even know that it is running. It runs only as a process.
XP has a CLI defrag available, 2000 does not. The program AutoDefrag is a little "cheat" which will launch the defragger in Win2000 without the snap-in so that it can be scheduled and such.
-Maestr0
Fraggin:
You aren't running that against a basic install of win2k because "defrag" doesn't exist in win2k. I tried your psexec command line against a win2k box and get file not found. Then I tried my command line "dfrg" and dfrg.msc in it's place and got told the same thing.
Funnily enough if you go to the "victim" box and type dfrg.msc at the start-run prompt it works fine but "defrag" gets a file not found error.
Maestro: Thanks for the "autodefrag" hint.