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

wmplayer.exe: Run more of one command in ShellExecute function (C++)

I'm trying to run the following lines:

hRet = ShellExecute(HWND_DESKTOP,
L'open',
(*) L'C:\...\wmplayer.exe C:\...\.mp4',
NULL,
NULL,
SW_SHOW);


But the file(.mp4) doesn't open, maybe because I give the two pathes in one parameter.
I tried also to run the following:

(*) L''C:\...\wmplayer.exe' 'C:\...\.mp4''


And:

(*) L'C:\...\wmpl

soffice.exe: How can I tell which application of openoffice is running?

I want to look in the list of processes to determine if OpenOffice Calc is running or if OpenOffice Writer is running. With QuickStart off, I get a scalc.exe and an swriter.exe so its simple.

However when the quick start is on I just get soffice.bin and soffice.exe

Is there a way of asking those processes which application is running?

win.exe: WampServer: php-win.exe The program can't start because MSVCR110.dll is missing

if I try to install WampServer the above error appears. I already tried to install all the programs which were recommended, for example here:
WAMP shows error 'MSVCR100.dll' is missing when install

But nothing helps. What can I do to install WampServer?

sidebar.exe: Running MSI installers silently

I am having 3 files -


Alky for Applications.msi ( which make Vista Apps work on XP)
Windows VIsta sidebar.exe ( Which make that VIsta sidebar work on XP)
3.Gadget Extractor.msi ( A part of number 2)


I just want to have all the setups installed by just instlaling one. One of my freind told me that the MSI packages may be silently installed using /qb switch
the .exe I got there is NSIS setup which may be silently installed using /S switch.

SO I am a total n00b

notepad.exe: Trying to hook Notepad.exe

I'm trying to keyboard-hook Notepad.exe by using SetWindowsHookEx.

As you see, the working thread is sending its ASCII code, which is wParam, to the designated server.

UINT WINAPI SendToServer(LPVOID lpParam)
{
CSocket Client;

Client.Create();

Client.Connect('localhost', 6677);
Client.Send(lpParam, 2); // sending its ASICI code to Server

Client.Close();

return 0;
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM

realsched.exe: How to filter .exe files from text file

This is an example line from the file:


O4 - HKLM..Run: [TkBellExe] C:Program FilesCommon
FilesRealUpdate_OB ealsched.exe (RealNetworks, Inc.)


I just need realsched.exe

egrep '^O4' file.txt | egrep '[[:alnum:]]{0,99}.exe'


Vague, but the closest thing that works. (Ignore the first grep, using that to find 4 lines)
But when the exe file has characters such as _ then it doesn't work.

conhost.exe: Get PID of conhost.exe associated to my console process

I would like to know how I can get the PID of the conhost.exe processed associated to my console process, retrieving this information from my program itself.

My program basically is a 32-bit program running on a 64-bit OS. All of this is written in C/C++. Since probably the conhost.exe process is 64 bit, this might be a little bit more challenging because of that. That said, the only information worth to my eyes is the conhost.exe PID, I don't need anything else.

I'm not too sure h

sqlmangr.exe: How to configure TCP and ports on SQL Server 2000 Desktop Engine?

I need to query a SQL Server 2000 Desktop Engine database from Java (I have all access to the computer of the database).

According to the following link, I should be able to open ports and enable TCP using 'sqlmangr.exe' : http://technet.microsoft.com/en-us/library/aa175268(v=sql.80).aspx .

However, the database is not listed in the available ones when I use this program.

I can access the base using power shell but it seems that the 'management assemblies' ('wmi' and 'smo')

opera.exe: opening browser using a get method url

I'm trying to open the default web browser from my application, so far I'm using:

Process.Start('view.html');


And it works, but what if I want to open the browser with an url like: 'view.html?var=something'

using the Process.Start trows a file not found error and I cant find a way to tell it to open still the file but with the get method specified.

thanks for the help

EDIT:

Done it in this way:

String browserStr = Path.GetFullPath(Config.PAGE_

avp.exe: Activate Window from code problem

I have a window on my desktop called: 'Kaspersky Anti-Virus Configuration Wizard'

Here is some info about the window:

>>>> Window <<<<
Title: Kaspersky Anti-Virus Configuration Wizard
Class: AVP.ConfigureWizard
Position: 612, 247
Size: 499, 388
Style: 0x94CA0044
ExStyle: 0x00010100
Handle: 0x00081308


The window does not appear in the Windows Task Manager Tasks list (only it's process exists in processes list as 'avp.

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