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

msiexec.exe: Visual Studo 2010: Windows Installer using msiexec.exe returns MSI Error 2727

I've got a Visual Studio Setup Project that uses the msiexec.exe file to create an Uninstall item as outlined in >> THIS << article on SO.

The Installer does not run.

When I launch the installer by double-clicking the setup.exe file, the 'Please wait while setup launches' screen barely blips on the screen before I am confronted with my error.



The Text is (for search functions):


The installer has encountered an unexpected error installing this packa

waol.exe: UFT is not recognizing Web Objects appropriately

My hard drive crashed and I had to perform a clean install of Windows. I installed UFT version 11.5 and I having issue with UFT identifying Internet Explorer Dialogs as Web Objects. It seems to be related only to windows that were opened through a Modal Dialog Process. If I launch a new test, the object repository can recognize the browser correctly, it is only objects under a Modal Window that are not being identified as web objects. They are being identified as WinObject : Internet Explorer_Se

werfault.exe: Detecting process crash - C++ code

Is there any way to detect process crash in windows 7 ? just to clarify upon every process crash windows creates the WERfault.exe ( windows error reporting) . i have driver that monitor the system by using the existing kernel callback mechanism of the kernel that notifies my
driver when a certain process event happens (using PsSetCreateProcessNotifyRoutine). the problem is i see that WERfault.exe created by svchost.exe but i can not find a way resolving which process has crashed.

msiexec.exe: NSIS: Failed to install using msiexec.exe

I try to install .msi file using msiexec.exe but it's not working although the $0 = 0 which indicates no error during the installation.

Here is my code:

ExecWait '$X86SYSDIRmsiexec.exe /a '$TEMPOVMjpegCgiIntegrationSetup-1.0.0.00000_AVTechMjpegCgiIntegrationSetup.msi' /qn /log '$INSTDIRmsi_ov3.log' ' $0
DetailPrint '..OV3 exit code = $0'


What's wrong with my code?

csrss.exe: What does the csrss.exe process do?

What is the purpose of the csrss.exe (Client/Server Runtime Server Subsystem) on Windows?

Maybe someone could give a good explanation or pointers to documentation? Unfortunately Google results are pretty noisy when searching a core process of Windows.

The reason I'm asking is that I got a BSOD from my service application which seems to be related to the csrss.exe process, at least this is what the analysis of the memory dump shows:

PROCESS_OBJECT: 85eeeb70

IMAGE_NAME

notepad.exe: What is Problem in Runtime.getruntime which does not open notepad.exe

when try to execute the servlet containing following code

Runtime rt = Runtime.getRuntime();
Process p = rt.exec('notepad.exe');


It doesn't launch the application in the environment windows server 2003 and Tomcat 5
but a process is being created as notepad.exe in the windows task manager.

In windows xp and tomcat 6 environment launches the notepad

i need to work on the windows server 2003 and tomcat 5

Thanks in advance

mysqld-nt.exe: taskkill Mysql from .ASPX — Permission Problems?

Our mysql instance occaisionally locks up during backups. Currently we must VPN into the corporate network (to obtain work I.P.), remote desktop into the server, open the task manager, and manually kill the mysqld-nt.exe process.

Instead of doing all of this we are attempting to create a simple webpage that we can log into to kill and restart the service.

The following block of code is wired up inside our new .aspx page works as I intended on my local desktop (running in VS debug m

thunderbird.exe: Piping current buffer as a string(!) to an external command

I have a problem piping the current buffer to an external command. Similar questions asked could not solve the problem.

I want to treat the content of the buffer as a string and simply pass it as an argument like this, where %s is the CONTENT of my file:

:!thunderbird.exe -compose body=%s


The usual way of using %w !{cmd} is not working here, because thunderbird doesn't read from STDIN, correct me if this assumption is wrong. (Piping buffer to external command in Vim)<

excel.exe: kill the Excel.exe from the .vbs file

Suppose I am running an .vbs script to work with Excel sheet,now if somehow due to any reason any error occurs,I want to quit that .vbs script to run and besides to kill the process EXCEL.EXE from that .vbs file immedaitely.

After killing that process EXCEL.EXE, i want all the data change has been made by the script on the excel sheet should need to be ROLLBACK

Is it possible?

UPDATE:

I have a code with me, but how should I embed it with my script,I couldn't understan

mplayer2.exe: Repeating list after post back form in ASP.NET and C#

I have some code retrieving the files from a folder using ASP.NET and C# and I display them using a CheckBoxList because the user will be able to select one of the files and then with a button at the end the user will have the ability to email that selected item.

The issue I am having is that after the item is selected and the email is sent, the page reloads and the items are duplicated and I am not sure why or how to corrected. Any help will be appreciate it.

The code is as follow

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