PRocesses: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
Dlls: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
Popular: svchost.exe | csrss.exe | rthdcpl.exe | spoolsv.exe | mrt.exe | lsass.exe | Home | Manufacturers

defrag.exe

Real Time CMD Output on Windows Defrag.exe

I am trying to capture the output on CMD on REAL TIME. I want to read every line that's being output. The following is my code:

private void Defrag2()
{
string osDrive = Path.GetPathRoot(Environment.SystemDirectory);
Process Psi = new Process();
System.Text.Encoding SysEncoding = System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentUICulture.TextInfo.OEMCodePage);
Psi.StartInfo = new ProcessStartInfo('cmd', @'/c defrag ' + osDrive + ' /a /u')
{
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
StandardOutputEncoding = SysEncoding,
StandardErrorEncoding = SysEncoding

};
Psi.EnableRaisingEvents = true;
Psi.OutputDataReceived += new DataReceivedEventHandler(OutPutDataRecieved);
Psi.Start();
Psi.BeginOutputReadLine();
}

void OutPutDataRecieved(object sender, DataReceivedEventArgs e)
{
this.DefStat(e.Data);
}

private void DefStat(string Line)
{
if (Line != null)
{
if (Line.Contains('do not need to def'))
{
defragstatustb.Invoke(new MethodInvoker(() => defragstatustb.Text = 'You do not need to defrag this computer.'));
}
if (defragRTB.InvokeRequired)
{ defragRTB.Invoke(new MethodInvoker(() => defragRTB.AppendText(Line + Environment.NewLine))); }
}
}


That code works well on Capturing CMD output in real time, EXCEPT when I try to run the Windows Defrag in CMD. For example: If I try to enter a command like 'Dir', it reads the output in real time, however if I try to run something like 'Defrag C: /f /u', it only reads the output ONLY after it completes the operation.

Any idea how to get this working ? Thank you.

View Complete Forum Thread with Replies

Related posts for defrag.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Can't call defrag from perl script on Windows 2008
C# run defrag.exe remotely
Real Time CMD Output on Windows Defrag.exe
Exitcode 6 using PsExec in Windows Service
Schedule using “at” CMD in LOOP
Process.Start in WindowsSystem32 folder
Batch File Creating Text File With Date
what the best and simplest way to find out whether a volume need defrag?
How do I create a batch script that creates a task for a specific user in the Active Directory?
C# How to Get Output from CMD (Command = “Defrag c: /U”) Before Proccess Ends.

defrag.exe: Can't call defrag from perl script on Windows 2008

I would like to run a perl script that runs the defrag command on windows. When I try to just use

system('defrag C:');


I get ''defrag' is not recognized as an internal or external command,
operable program or batch file'. I get the same error even if I give the full path of C:WindowsSystem32defrag.exe. Also, any test for the existence of defrag.exe fails. For example:

if(-f 'C:\Windows\System32\defrag.exe'),

if(-x 'C:\Windows\System32\defrag.exe'), and
<

defrag.exe: C# run defrag.exe remotely

I am trying to create a utility to defrag all machine on my network. I have had success using WMI's Defrag and DefragAnalysis methods, however they are not compatible with Windows XP. This is a problem as we have some XP machines on the network.
I have been able to locally invoke the defrag.exe process on an XP machine to perform a defrag however I am having problem invoking it on remote machines. Below is my code which works locally, could someone please help me in making this work for re

defrag.exe: Real Time CMD Output on Windows Defrag.exe

I am trying to capture the output on CMD on REAL TIME. I want to read every line that's being output. The following is my code:

private void Defrag2()
{
string osDrive = Path.GetPathRoot(Environment.SystemDirectory);
Process Psi = new Process();
System.Text.Encoding SysEncoding = System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentUICulture.TextInfo.OEMCodePage);
Psi.StartInfo = new ProcessStartInfo('cmd', @'/c defrag

defrag.exe: Exitcode 6 using PsExec in Windows Service

I am using PsExec to defrag machines remotely on my network. This works fine in my c# code, but because it also does a bunch of other tasks and I want it to run continuously I have converted it into a windows service.

When the code gets to the PsExec portion it exits with the code 6 which seems to mean 'The handle is invalid' I have tried entering a username and password with sufficient privileges without success, I have also tried adding -s to use the system account which did not help e

defrag.exe: Schedule using “at” CMD in LOOP

I want to defrag disks remotely. I tried this short script:

for /f 'delims=' %%s in (servers.txt) do (
at \%%s 20:00 defrag.exe c: -f
)
@pause


Normally others command work e.g. ping %%s. Unfortunately when I use 'at' command that doesn't work (The command 'loops' on first server and after that CMD window closes).

What am I doing wrong?

defrag.exe: Process.Start in WindowsSystem32 folder

Trying to launch a file located in System32 as administrator but it keeps telling me it doesn't exist.

Error: System can't find specified file
Build Target Platform is: x86.
Current OS: Windows 8.1 x64. I'd rather not have 2 different .exes for a 32 and 64 bit os.

p.StartInfo.Verb = 'runas';
p.StartInfo.FileName =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),'Defrag.exe');
//above points to c:windowssystem32defrag.exe
p.StartInf

defrag.exe: Batch File Creating Text File With Date

I have a batch file to run a defrag on a computer - as below. At the moment it is creating the text file named ComputerName.txt


@echo off

defrag.exe c: -f -v >'C:DefragComputerName.txt'


How can I get the date to also ammend to the end of the text file? IE:


ComputerName.2011.02.08.txt

defrag.exe: what the best and simplest way to find out whether a volume need defrag?

I am writing a application that monitor the system's health, user should know when they need to defrag the volumes.

What I am thinking is calling the 'defrag.exe /A' then analyze the output result to see whether it contains 'You do not need to defragment this volume.'

But it's slow and very bad, I fount that the 'Analyze' is really quick on the MyDefrag.exe.

Anyone could tell me what's the best and simplest way?

defrag.exe: How do I create a batch script that creates a task for a specific user in the Active Directory?

This is the code I currently have, but all it does is create the task for me rather than that user.

@echo off
echo Enter Computer Name:
set /p compname=

schtasks.exe /create /sc once /tn defrag /tr '\compnameC$Windowssystem32defrag.exe c:' /st 14:33:00
pause

defrag.exe: C# How to Get Output from CMD (Command = “Defrag c: /U”) Before Proccess Ends.

I'm calling Defrag.exe from my c# application. I want to get output of defragmentation proccess when it's updated.

I want this output(in red rectangle) to be printed in my application.(When 11% progress percentage updated it should also be printed.) :



I'm using this code:

Process selectedProc = new Process();
selectedProc.StartInfo.UseShellExecute = false;
selectedProc.StartInfo.RedirectStandardOutput = true;
selectedProc.StartInfo.WindowStyle = ProcessWindo

ctfmon.exe: Batch file has errors when run, but enter trough command line works fine

I'm helping one of my friends with his QA work. A lot of the time ctfmon.exe is always running in the background and he says it takes up memory on the computer for when he's testing. My friends work machine is using Windows XP

He already tried what was said in this article but it didn't help.
http://www.howtogeek.com/howto/windows-vista/what-is-ctfmonexe-and-why-is-it-running/

We then tried to create a simple batch file that would stop the process for him.
Here are the two fi

ekrn.exe: Disable Eset Smart Security using metasploit

Im trying to disable Eset Smart Security 7, in order to do this I have to shutdown his service ekrn.exe so I started with this:

sc queryex ekrn

SERVICE_NAME: ekrn
TYPE : 110 WIN32_OWN_PROCESS (interactive)
STATE : 4 RUNNING
(NOT_STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0<

mcshield.exe: html a onclick exploits causing antivirus to go crazy

Does anyone know why things like:

<a href='#' onClick='javascript_foo_function(1,'foo',34); return false;'>


Cause most antivirus (such as McAfee mcshield.exe) to go haywire? What is the exploit that they are looking to protect against? Many programs (mcafee and norton) do some insane calculations that seem to exponentially increase with the number of links, a few hundred links like that one a page can result in 2 minutes before the page is useable. I wonder what they are

winword.exe: c# interop winword.exe doesn't Quit()!

I feed multiple docs to the below method and see winword.exe disapear as expected on over 15 diferente PCs running WinXP 32bit to Win8 64bit having Office 2000 onwards. On 1 nightmare PC that has Trend's Antivírus running, winword.exe (Always, every time) interrupts the loop with a 'File in Use' exception (turning Trends off allows it to work again). Any ideias to keep Trends on?

void loop()
{
Microsoft.Office.Interop.Word._Application app = new Microsoft.Office.Interop.Word.Applica

apache.exe: PHP_iisfunc.dll is crashing wil i am trying access the detail for upload

Faulting application Apache.exe, version 2.0.63.200, faulting module php_iisfunc.dll, version
5.2.7.7, fault address 0x00001085.

Any one having any idea about above error it thrown in Event view and crashes the apache server

update.exe: Exe name like update.exe blocked by UAC in scheduled task

I have a problem with windows UAC, scheduled tasks and a executable named 'dbupdate.exe'. I have full power over source code, manifests and so on, but not over user systems (short: normal software engineer ;-). Language is Delphi, but shouldn't be important I think.

I have a problem using an application in task scheduler in windows vista and windows 7. The program is named dbUpdate.exe. It has built in a xp/vista manifest, which configures that the program should be started 'asInvoker'.

lsm.exe: choose the column from a cmd command

is there a way to choose the columns from windows cmd command?
for example:
when i use the following command:

tasklist


i get this result:

Image Name PID Session Name Session# Mem Usage
System Idle Process 0 Services 0 12 K
System 4 Services 0 920 K
smss.exe 260 Services 0 764 K
csrss.exe

wmplayer.exe: Play() function not working in R [duplicate]

By using R packages like tuneR and seewave I generated sounds that I want to play with some software that is not Windows Media Player but I don`t know how to set this up. This command

setWavPlayer('mplay32')


is the only thing that works (and its WMP). When I try something like this

setWavPlayer('C:/Program Files/foobar2000/foobar2000.exe')


the synth or play command just gives this error when I try to playback my sound

'C:/Program' is not recognized as a

consent.exe: How I can get process path or pid from consent process (UAC)

When I launch an application which requires UAC elevation, I see the UAC consent window, which is shown by the process 'consent.exe'.

I'm trying to determine the path or process ID of the application that is being launched. How can I do this?

msdtc.exe: When running odbcad32 as Administrator, machine-wide tracing still not available

I'm running the 64-bit odbcad32.exe on an x64 Windows 2008 R2 (6.1 build 7601 SP1) system. The system does not have UAC enabled (it's an AWS instance, and they default to UAC off).

The ODBC administrator does not think it's running under an Administrator account, even though it's running under the literal Administrator account. No other Admin-only tasks are causing problems.

The issue persists even if I (unecessarily) shift-right-click on the ODBC administrator and choose 'Run as A

EUROBYTE TOOLS - cleans and speeds up your computer

You know it: the longer you own your computer, the slower it runs and the more often the stucks.
Can I change it?
Of course Yes.

Try EUROBYTE TOOLS, program, that cleans and speeds up thousands of computers around the world.
It's quick, automatic and effortless.
So easy to use that even a beginner can use it.

See this page in: English Espanol

Disclaimer
This web site and all information written here is for information purposes only, WITHOUT ANY VARANTY. YOU ARE USING THIS PAGES ON YOU OWN RISK. You should always verify the accuracy of information provided on this page. We pay a big attention to provide you with the correct information. However, many spyware and malware programs use filenames of usual, non-malware processes and DLLs. If we have included information about defrag.exe that is inaccurate, we would appreciate your help by getting us know about your user review. Also, web links to software and DLL vendors are provided just for your conform, and we cannot guarantee its accuracy nor relevance with DLL or process listed on this page. We are not affiliated with this pages. We are not responsible for misprints on this site or changes occured since this page was published. The product, software and operating system names mentioned on this web site, can be copyrighted and registered trademarks of their owners.

defrag.exe