Remote Command Line for Defrag?
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Remote Command Line for Defrag?

  1. #1
    Senior Member
    Join Date
    Aug 2003
    Posts
    224

    Remote Command Line for Defrag?

    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
    There are many rewarding oppurtunities awaiting composure from like minds and great ideas. It in my objective to interconnect great things.

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Posts
    247
    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.
    www.ADigitalPimp.com
    There is a ghost in the machine, and he is my friend.

  3. #3
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    You can't on XP/2000 because it runs from the msc and you can't pass switches to it.
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  4. #4
    Senior Member Maestr0's Avatar
    Join Date
    May 2003
    Posts
    604
    You can use the program Autodefrag found here and schedule the task as posted here:
    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
    -Maestr0
    \"If computers are to become smart enough to design their own successors, initiating a process that will lead to God-like omniscience after a number of ever swifter passages from one generation of computers to the next, someone is going to have to write the software that gets the process going, and humans have given absolutely no evidence of being able to write such software.\" -Jaron Lanier

  5. #5
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    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?
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  6. #6
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,914
    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

    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
    I typed defrag c: and sure enough it started defragging my C drive..
    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  7. #7
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    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.....
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  8. #8
    Senior Member
    Join Date
    Aug 2003
    Posts
    224
    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.
    There are many rewarding oppurtunities awaiting composure from like minds and great ideas. It in my objective to interconnect great things.

  9. #9
    Senior Member Maestr0's Avatar
    Join Date
    May 2003
    Posts
    604
    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
    \"If computers are to become smart enough to design their own successors, initiating a process that will lead to God-like omniscience after a number of ever swifter passages from one generation of computers to the next, someone is going to have to write the software that gets the process going, and humans have given absolutely no evidence of being able to write such software.\" -Jaron Lanier

  10. #10
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    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.
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •