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 | Top 1000

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

firefox.exe: Failed to connect to binary FirefoxBinary(C:Program Files (x86)Mozilla Firefoxfirefox.exe…

I am using FireFox 18 with Selenium 2.29.0.
While running test exception occurs

Failed to connect to binary FirefoxBinary(C:Program Files (x86)Mozilla Firefoxfirefox.exe) on port 7056; process output follows: null

It seems strange that this error seldom occurs. Let's say I have 20 tests in my id, the 'failed to connect' error occurs in 2 tests sometimes 3 and sometimes it doesn't occur.

Can't figure out why is it happening. If this is some how version problem or somethin

notepad.exe: Launch notepad.exe from a PHP file

In an attempt to simplify a problem I am having running a batch file from within PHP on a WAMP windows XP system I am trying to launch notepad.exe from a PHP file. I have a PHP file containing....

<?php
exec('c:windows otepad.exe');
?>


When I run the PHP file I can see the notepad.exe process start in the task manager but notepad itself does not open. What am I doing wrong?

excel.exe: Convert xls to csv or kill EXCEL.exe process

I have an application which automates a reporting system originally based off DTS packages. The web based app is currently writing the output xls file to another server on the network. I am finding that an instance of excel is left running on the server being written to even after the website is closed. I would like to either be able to change my exiting routine to output a csv file rather than a xls file, or kill the EXCEL.exe process across networked machines. Help please!

EDIT:

alg.exe: Exception during char operation

I'm practising programming and got something and I don't know the reason.

Here is my source with the place of the error:

#include <iostream>
#include <string.h>
#include <vector>
#include <stdio.h>

int main()
{
// the max length of one line is given
std::vector<char*> tmp = {'abc', 'abcba', 'abcd'};
for (char *input : tmp)
{
int counter = 0;
int length = strlen(input);
char

raserver.exe: Eclipse Java Profiler prematurely exiting without results

I've installed the Java Profiler for Eclipse Keplar as per these instructions (For windows). I then applied these instructions to start profiling my Java application.

I opened a command prompt and ran RAServer.exe which I left running. I then set the profiling configuration to that of a Java application, and selected my id with the 'main' function for the profiler to execute. (A JFrame).

However when I execute the profiling by going to Run > Profile in the Eclipse IDE, nothing h

java.exe: Get path to java.exe [duplicate]

This question already has an answer here:


Find absolute java.exe path programatically from java code

1 answer




I need help with getting path to java.exe. But I need it to do with java code. And I want it to work on Linux and Mac and on other systems too, so there won't be java.exe, I don't know what's there.

Does anyone know how to do it? Thanks.

java.exe: Symbols not loaded for java.exe

Im sure this question is probably worded poorly, so please ask me questions and Ill respond promptly.

Im compiling some code in debug and putting the resulting .dll where my web server starts from.
When I start the web server, a java.exe process gets started.
Im trying to hit a breakpoint in my code by attaching to this java process through Visual Studio,
but Im getting the 'no symbols have been loaded for this document' problem.

I think I need the .pdb symbol file for thi

mrt.exe: g++.exe [Warning] linker input file unused because linking not done

I'm having some trouble with a C Makefile.
It happens when I complile while opening the project file.

Here are the error:


[Warning] overriding recipe for target `DuLieuNganHang.o'

[Warning] ignoring old recipe for target `DuLieuNganHang.o'

g++.exe [Warning] linker input file unused because linking not done

g++.exe g++.exe D:TinNCMRTg++.exe DuLieuNganHang.o: No such file or
directory.

g++.exe g++.exe D:TinNCMRTg++.exe DuLie

monitor.exe: I would like to see the process status whether which is running or Not responding / Hung in …

I would like to see the process(APPLICATION) status whether which is running or Not responding / Hung in between.

eg: Actually I am running third party tool in my WIN 7 PC where it is getting hung while running. I tried the below way but it doesn't help me:

TASKLIST /fi 'IMAGENAME eq MONITOR.exe /fi 'STATUS eq running'


Here this command shows always the process is running even the process hung.

I'm stuck here can somebody help please...

php.exe: Can't locate php.exe

I am new to web programming,
I have installed PHP for webmatrix. my php sites work perfectly but I need to use 'php tools' in command line but it gives error ''php' is not recognized as an internal....'
I know first, I should locate php.exe file but although I searched a lot, I could not find it.

Where does wps install it? or What should I do to use 'php' command in command line.

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