windows

Locking Executing Files: Windows does, Linux doesn't. Why?

I noticed when a file is executed on Windows (.exe or .dll), it is locked and cannot be deleted, moved or modified. Linux, on the other hand, does not lock executing files and you can delete, move, or modify them. Why does Windows lock when Linux does not? Is there an advantage to locking? ...

How to check if OS is Vista in Python?

How, in the simplest possible way, distinguish between Windows XP and Windows Vista, using Python and pywin32 or wxPython? Essentially, I need a function that called will return True iff current OS is Vista: >>> isWindowsVista() True ...

NTFS performance and large volumes of files and directories

How does Windows with NTFS perform with large volumes of files and directories? Is there any guidance around limits of files or directories you can place in a single directory before you run into performance problems or other issues? e.g. is a folder with 100,000 folders inside of it an ok thing to do ...

Getting System Date in MSVC 6.0

I am trying to get system date in a C program on a MSVC++ 6.0 compiler. I am using a system call: system("date /T") (output is e.g. 13-Oct-08 which is date on my system in the format i have set) but this prints the date to the i/o console. How do i make take this date as returned by above system call and store it as a string value...

Getting DNS servers on Windows

I'm using the DnsQueryConfig Win32 function to get the DNS servers used by Windows. This works fine for IPv4 addresses, but what if the DNS servers have IPv6 addresses? ...

How do I create a symlink in Windows Vista?

I am looking to create symlinks (soft links) from Java on a Windows Vista/ 2008 machine. I'm happy with the idea that I need to call out to the JNI to do this. I am after help on the actual C code though. What is the appropriate system call to create the link? Pointers to some good documentation on this subject would be very much appreci...

How do I determine number of window handles an application is using?

What is the best way to determine how many window handles an application is using? Is there a tool or a WMI performance counter that I could use? I would like to run up an app and watch a counter of some sort and see that the number of window handles is increasing. for (int i=0; i < 1000; i++) { System.Threading.Thread.Sleep(1000...

PHPs mime_content_type() fail on windows.

I know mime_content_type() is deprecated, but it seemed to me the alternative is worse at the moment. Finfo seems to require adding files and changing ini directions on windows; I don't want to require this for the script I am making. I need to find the mimetype of files, but when calling mime_content_type($filename) on windows it fails...

Can I determine when a default printer was set on windows

We are trying to trace the time a windows default printer was changed and by who or what. Any ideas? ...

How do I uninstall a Windows service if the files does not exist anymore?

How do I uninstall a .NET Windows Service, if the service files does not exists anymore? I installed a .NET Windows Service using InstallUtil. I have now deleteded the files, but forgot to run InstallUtil /u first, but the service is still listed in the Services MMC. So I guess I have to go into the registry? Or is there a official way...

Reduce flicker with GDI+ and C++

I'm using GDI+ in a C++/MFC application and I just can't seem to avoid flickering whenever the window is resized. I have already tried these steps: returned TRUE on OnEraseBkGnd(); returned NULL on OnCtlColor(); used double buffering according to this code: void vwView::OnDraw(CDC* pDC) { CRect rcClient; GetClientRect(rcCli...

Executing multiple commands from a Windows cmd script

I'm trying to write a Windows cmd script to perform several tasks in series. However, it always stops after the first command in the script. The command it stops after is a maven build (not sure if that's relevant). How do I make it carry on and run each task in turn please? Installing any software or configuring the registry etc is c...

Code for checking write-permissions for directories in Win2K/XP

Greetings! I am trying to check directory write-permissions from within a Windows MFC/ATL program using C++. My first guess is to use the C-standard _access function, e.g.: if (_access("C:\mydir", 2) == -1) // Directory is not writable. But apparently on Windows 2000 and XP, _access can't determine directory permissions. (i.e. the...

How do I list installed MSI from the command line ?

We recently switched our Windows software packages from RPM (cygwin) to MSI (wix). Having a native packaging is a much welcome change and we intend to stick with it. However, MSI feels overly complicated for what it does and doesn't seem to provide some basic abilities. But I'm probably mistaken. Is there a way to list all installed ...

How do I install an MSI synchronously ?

To do an unattended installation of any MSI package, one can simply use the following command: msiexec /qn /i package.msi However, this triggers an asynchronous installation: if you happen to chain 2 dependent installations, you will have to wait somehow for the 1st installation to complete. Is there a way to do this from the command...

How can I get the path of a Windows "special folder" for a specific user?

Inside a service, what is the best way to determine a special folder path (e.g., "My Documents") for a specific user? SHGetFolderPath allows you to pass in a token, so I am assuming there is some way to impersonate the user who's folder you are interested in. Is there a way to do this based just on a username? If not, what is the minim...

xcopy /exclude issue

I am trying to run xcopy that copies files excluding .obj, etc. What I am seeing is that Microsoft.Practices.ObjectBuilder.dll is not copied when my excludes.txt file contains .obj as an extension. When .obj is removed, I Microsoft.Practices.ObjectBuilder.dll is copied correctly. This does not happen to other dlls though. Does anyone ha...

Determine if IP is blocked

Does anyone know if it is possible to reliably determine (programattically C/C++...) whether or not a firewall or IP filtering software is installed on a Windows PC? I need to detect whether a certain server IP is being blocked in my client software by the host OS. I don't need to worry about external hardware firewals in this situatio...

OS Compatibility for various .NET Framework versions

What are the minimum OS requirements for each of the .Net frameworks? E.g. for which version is it impossible to run each OS on: Windows 95 Windows 98 Windows 98SE Windows ME Windows NT 3.x Windows NT 4 Windows 2000 I believe all .Net frameworks are compatible w/ XP, Vista, Windows Server 2003, and Windows Server 2008 (please correc...

What's the best free MySQL backup solution on a windows server?

I was wondering what is the best free MySQL backup solution on a windows server? I am interested in backing up the data only. Constraints free solution backup should be done to somewhere outside the server windows only mysql only if you provide a suggestion with batch files & co. please add source code. thx. ...