windows

create a log from a batch file

I have a batch file (.BAT) and would like to capture its output into a file automatically every time it is run. I know I can use redirection but then I wouldn't be able to watch it as it's running. Also, other people use this batch file and I want the log to be created without the user having to do anything special. ...

Why is the sleep-time of Sleep(1) seems to be variable in Windows?

Last week I needed to test some different algorithmic functions and to make it easy to myself I added some artifical sleeps and simply measured the clock time. Something like this: start = clock(); for (int i=0;i<10000;++i) { ... Sleep(1); ... } end = clock(); Since the argument of Sleep is expressed in milliseconds I ...

How to get all windows groups?

I wrote this to get the groups a particular user belongs to: DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"); DirectoryEntry user = AD.Children.Find(completeUserName, "user"); object obGroups = AD.Invoke("Groups"); foreach (object ob in (IEnumerable)obGroups) { // Create object for each grou...

Which API should I use for playing audio on Windows?

There are many ways of playing sounds on Windows. Which are the differences, advantages and disavantages of each method? I know there are at least 5 methods: 1991 WinMM.dll/mmsys.dll PlaySound 1995 MCIWnd (as suggested by @casablanca) 1996 DirectSound 1998 WaveOut 1999 ASIO 1999 Windows Media Player ActiveX control? 2005 WASAPI (which...

PHP on Windows: LDAP (5.2) or Fileinfo (5.3), but not both?

I have got PHP 5.2.14 running successfully on Windows, with the LDAP extension loading and working correctly. I installed 5.2 because it appeared to be that php_ldap.dll wasn't available for 5.3. Now it looks like the Fileinfo extension is only available for 5.3! (I'm a linux chap mostly, and have generally been sheltered in the happy...

How to Read and validate data of a excel sheet through .NET

Hi, I have a excel sheet contains three columns Name, Email ID and Contact No. I would like to read data from a excel data and check through my code that the Email ID column contains @ sign, Contact No should be of maximum 10 digits, I would like to do these types of validation. Please suggest. ...

How can I use Pik for Ruby in Git Bash on Windows?

I'm running multiple versions of Ruby (and Rails) on Windows and use Pik to switch between them. At the command line, I'm able to call > pik list 186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] 192: ruby 1.9.2p0 (2010-08-18) [i386-mingw32] to get a list of ruby versions available, and use > pik 192 > ruby -v ruby 1.9.2p0...

Any good tool to convert HTML entities in HTML documents to plain UTF characters?

I have many HTML documents containing many HTML entities of Unicode code point representation, e.g. &#1576;&#1585;&#1608;&#1581; Is there a good tool to convert HTML entities in multiple HTML documents to plain UTF-8/UTF-16/UTF-32 characters? I want an offline converter tool that can do a batch job for this purpose. ...

Play an audio file in Windows 7 Phone

Hi I am working on Windows 7 based application development in Silverlight. I have not been able to find a way to play a an audio file in windows 7 phone programmatically. I have been googling it since past few days but i could not get any solution of that. There is a class SoundPlayer in C# but i guess its not available in Windows 7 Phon...

EnumProcesses() vs CreateToolhelp32Snapshot()

I was wondering if there are any differences - mostly performance wise - between the two Win32 API functions EnumProcesses() and CreateToolhelp32Snapshot() for enumerating all active processes and loaded modules. Or if one is better than the other to use and why. ...

Platform Builder Project.Dat Issues

I am trying to customise an image for Windows CE6 using platform builder. The image itself is fine. However, my customisation is failing. My project.dat file looks like this: Directory("\Windows\StartUp"):-File("StartUpBat.bat","\Windows\StartUpBat.bat") Directory("\Hard Disk"):-File("RegFlushKey.exe","\Windows\RegFlushKey.exe") Direc...

From FreeBSD webhost, trying to connect to Access database on Windows through SSH2

My webhost is Pair.com, which runs FreeBSD. PHP is compiled with iODBC. I have SSH2 compiled and installed and tested. I can connect to the Windows machine through the firewall and get a directory listing. What I need is the incantation to open an Access database file through the SSH connection. (Very low-traffic site, so Access sho...

create a windows 2000 batch file that executes a mysql stored procedure

I want to create a batch file that I can run from the desktop. This batch file should execute a stored procedure in mysql. This is what i have so far, the batch file logs into the server but it doesnt execute the stored procedure <---- start: run_stored_proc.bat -----> cd\ cd Program Files cd mysql cd mysql server 5.1 cd bin mysql.e...

LoadImage is working differently based on win color setting

HI, I am using loadImage to load an 24bit bmp file and then try to get the bmp info hBitmap = (HBITMAP)LoadImage(NULL, "logo.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE) GetObject( hBitmap, sizeof(BITMAP), &bm ); When I do the same operation with windows color display setting 32 hi color than i got ...

Python: Existing environment variables which need to be added again to execute

I'm trying to execute a command which runs a program that uses perl and python. Although both of them are already in PATH, I get this error 'perl' is not recognized as an internal or external command,operable program or batch file. 'python' is not recognized as an internal or external command,operable program or batch file. So I tried o...

renaming all files in a director tree appending the parent folder name to all the files in their subdirectories

Hi. - I have a number of directories in Z:\AEPMDOCS These directories also have one or more subdirectories with files in them - how can I rename all the files within the directory tree to include the first Directory at he begining of the Filename. EXAMPLE Z:\AEPMDOCS\JONESA\test1.txt should become Z:\AEPMDOCS\JONESA\JONESA-test1.t...

how to create web sites with Visual studio 2010 on a remote iis7

i have windows server 2008 running on my pc. i have been able to setup client/server network with a domain. i login on th e client pc and tried to create a website project with VS2010. but each time i choose iis7 of the server i get the following error : the web server does not appear to have any authentication methods enabled. It asked...

Why do fewer developers use Delphi?

This is a non technical question. I am a Delphi developer so I have met many developers from the community , but only a few have said they know a programming IDE called Delphi and only a very very few know Delphi. I am very comfortable with Delphi and I always prefer Delphi for windows development(but I know many developers on the inter...

Windows service stops because of unknown reason

Hi, I have a WCF application which is hosted as a windows service in windows server 2008. But for some unknown reason the service stops sometimes. I checked the eventviewer, i see that an error has occured but its not saying why? It is only saying 'service terminated unexpectedly. It has done this 1 time(s).' Please help. ...

"silverlight for Windows 7 Phone" option is not shown in "Add new Item" option

Hi I have downloaded and installed Microsoft Visual Studio 2010 Express for Windows 7 Phone. Problem is that i cant see "Silverlight for Windows Phone" option when I right click my Project name and select Add -> New Item option. I can only see "XNA Game Studio 4.0" under "Visual C#" category. I have tried installing Silverlight SDK sepa...