windows

Efficiently wait for a flag state change without blocking resources?

Thread to wait infinitely in a loop until a flag state change, then call function. pseudo code illustration: while (true) { while (!flag) { sleep(1); } clean_upfunction(); } Currently: Using the multithreaded versions of the C run-time libraries only No: MFC Question: Is there a more efficient way o...

Adding Comments [Meta Data ] to a File

Hi I am pretty sure this is possible just not sure what is the term for it and how to do it. Basically if you right click on any file and go to properties then summary , you can add comments etc. to a file. What i want to know is how would you do this problematically from c#. Also once you have added comments , how can you at a latte...

Can I make an Apache running on Windows case-sensitive?

The Windows file-systems (FAT, NTFS) do not care about the case of file names (case-insensitive). Consequently programs - like the Apache web server - running on windows handle file case-insenstive. When you create web sites on Windows you inadvertently create links, etc. that do not match the case of the actual file name. You usually n...

Hide Command Window of .BAT file that Executes Another .EXE File

This is a batch file in Windows. Here is my .bat file @echo off copy "C:\Remoting.config-Training" "C:\Remoting.config" "C:\ThirdParty.exe" This works fine except the .bat file leaves the command window open the whole time the "ThirdParty" application is running. I need the command window to close. I would use the short-cu...

Scheduled console app vs Windows service? When is it appropriate to use each

I just read this: http://stackoverflow.com/questions/442264/what-is-the-benefit-of-developing-the-application-as-a-windows-service but I'm still unsure of when to use a windows service. I have a couple tasks that need to be run at intervals (i.e. every 5 minutes). Which project type should I use? Are there any examples of the types of a...

Free code coverage tools

Are there any free code coverage tools for native (not managed) code? For either Windows or Linux platforms? ...

Number of sockets available for a JDBC connection at Windows 2003

My team built a Windows Service in Java that connects to a SQL Server 2005 in a Windows 2003 Server, using pure JDBC (no connection pooling) with the JTDS driver. After a while, the method that opens the connections to the database start raising exceptions with the following stack trace: java.net.BindException: Address already in u...

Windows 2000 Server with Interdev Users - how to find and change

I've inherited an Windows 2000 server with Interdev-enabled sites. I don't know how to find out which "interdev users" are mapped to domain/local accounts or how to change the users/passwords on an Interdev site. Someone mentioned they could do it with "FPSE" or "Interdev" but I'm not sure what that means. Any ideas? ...

Distributed network-quality monitoring for Windows

My office is cursed with a very unreliable network. From time to time things just seem to stop working - the servers are all fine. We think the fault lies in the wires and routers between our computers. My team looks after a large number of Windows servers and workstations. Each PC runs a number of distributed applications, hence any c...

How to Tell FORFILES to Execute Command on Path?

I'm missing something (obvious?) about escaping my strings or spaces in the following Windows Server 2k3 batch command. FORFILES -m *.wsp -c "CMD /C C:\Program^ Files\Common^ Files\Microsoft^ Shared\web^ server^ extensions\12\bin\stsadm.exe^ -o^ addsolution^ -filename^ @FILE" Results in the following error 'C:\Program Files\Common...

Virtual COM Ports in Windows - Fax emulator

I have a Windows application that utilizes a 3rd-party tool (FaxMan) to send faxes via a COM port attached to the PC. In order to stress test my application I want to create some virtual COM ports that pretend to have fax modems attached. I then want to 'spoof' the sending of faxes, without physically sending anything. The virtual COM...

Machine's domain name in .NET?

There gotta be an easy way to do this, I can't believe there's none. I have scanned through net and found, like, 20 different methods to find in which domain current user is, but none to get domain (or workgroup) of current machine. In unmanaged c++ this is retrieved by: WKSTA_INFO_100 *buf; NetWkstaGetInfo(NULL, 100, (LPBYTE*)buf); do...

XAMPP vs basic Windows

I am installing the Open Source app, Laconica, for microblogging. There are instructions to install it using XAMPP. Now I prefer to do a straight Windows install. In doing so, I have run into some problems related to missing variables, improper DB variable definitions, etc. Now my colleague wants to try using XAMPP. But my question i...

Can't set Ifilter debugging on Vista. Regedit HKLM\Software\Microsoft\Windows Search\Gathering Manager:DebugFilters results in error "Error writing value's contents"

Can't set Ifilter debugging on Vista. Per instructions at http://blogs.msdn.com/ifilter/archive/2007/02/06/debugging-ifilters-with-wds-3-0-and-windows-vista.aspx ... I use regedit to set HKLM\Software\Microsoft\Windows Search\Gathering Manager:Debug Filters to 1, but when I click OK, I get message results in error "Cannot edit D...

Windows Server Crash Dump Analysis

I'm not certain that this is the right venue for this question, but a programmer friend of mine said I should try this here. My company's main application is hosted on a terminal server running Windows Server 2008. Since last Thursday we have seen this server crash and reboot 3 times, and we just went live with this server on the previ...

powershell script exits in "if" clause if run from command prompt

I am feeling surprised by the difference between two seemingly identical scripts. first.ps1: "A" if ($true) { "B" } "C" second.ps1: "A" if ($true) { "B" } "C" Now open a CMD window, and run these scripts like this: powershell - < first.ps1 powershell - < second.ps1 first produces: A B C while second produces jus...

What's the difference between RealGetWindowClass and GetClassName? (or what is a "Window type" versus a "Window class name"?)

There is a difference in the description on MSDN, however, I do not understand what the text means what the difference is. The GetClassName function retrieves the name of the class to which the specified window belongs. The RealGetWindowClass function retrieves a string that specifies the window type. As an example using windows calc....

Is there a way in a batch script to keep the console open only if invoked from Windows Manager?

I have a DOS batch script that invokes a java application which interacts with the user through the console UI. For the sake of argument, let's call it runapp.bat and its contents be java com.example.myApp If the batch script is invoked in a console, everything works fine. However, if the script is invoked from the Window Manager, the...

The difference between the 'Local System' account and the 'Network Service' account?

I have written a Windows service that spawns a separate process. This process creates a COM object. If the service runs under the 'Local System' account everything works fine, but if the service runs under the 'Network Service' account, the external process starts up but it fails to create the COM object. The error returned from the COM ...

Auto Include Files In A C# Project

Hi This may not really sound hard to do but it is currently killing me. Currently i have a Visual Studio 2008 C# Project that i use in conjunction with a DAL generator , its nothing fancy at all besides generating files that i can use in the project to access the database. The problem i am having is that after the generator has run and...