windows

Clearing the Windows "Run" dialog history without rebooting

I am currently working on a program to immediately clear the list of previously-run-commands which appears in the Windows Start -> Run dialog. The procedure for clearing this list by removing the *HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU* key is well documented; however, before these changes take effec...

Sounds for build error/success in Visual C++?

On long Visual C++ builds, it would be really helpful to hear some sort of (optional) sounds for such build/compile results as: individual compile error file compile success/failure build success/failure batch build success/failure Does anyone know how to enable sounds for these kinds of build occurrences in Visual C++ (especially Vi...

WinDbg Dr. Watson minidump - requires pdb/dll originally built for installed version?

I have a mindmp file from a target's application crash. Is it possible for me to rebuild the dll/pdb files for a version of software and have windbg load symbols correctly? My problem is that our pdb files are only kept for major releases (unfortunately). This is a daily build, which I can rebuild myself, but I'm getting tripped up on ...

How can I script a no-cost notification of batch file errors/returns?

I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is. Here's the scenario, I have a text file output of an "sc" command. I want to send that file but not as an attachment. Also, I want to see the initial status quickly in the subject of the ema...

How can I call a long-running external program from Excel / VBA?

What is the best way to run an external program from excel. It might run for several minutes. What's the best-practice about how to to this. Ideally, A model dialog box that let's the user know that the process is executing. If the executable fails, the user should receive a notification. A timeout should be enforced. A cancel butto...

How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows?

How to programmatically associate a name like COM51 to a physical serial port in Microsoft Windows? To manually perform the operation I can follow the steps described in link text Open Device Manager with devmgmt.msc Double-click Ports (COM & LPT). Right-click the port I want, and then click Properties. On the Port Settings tab, if ...

Page down and Page up in Emacs

I am trying to learn Emacs and trying to find best keyboard layout for me. One thing is really annoying me. I have added following lines to .emacs (global-set-key "\C-y" 'scroll-up) (global-set-key "\M-y" 'scroll-down) And it works but, if I hold Control and press ‘y’ few time it will scroll page down every time bat if I hold Windows ...

Put a process in a sandbox where it can do least harm

I'm looking for the concept to spawn a process such that: it has only access to certain libraries/APIs it cannot acess the file system or only specific parts it can do least harm should malicious code run in it This concept is known as sandbox or jail. It is required to do this for each major Operating system (Windows, MacOSX and Li...

Fastest small datastore on Windows

My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order. Right now the app uses the registry to store each object's state. This is nice because: It is simple It is very fast Individual object's state can be read/written without needing...

Determining if a folder is shared in .NET

Is there a way through the .net framework to determine if a folder is shared or not? Neither Diretory, DirectoryInfo or FileAttributes seem to have any corresponding field. One thing I forgot to mention was that I want to be checking for network shares. But I'll investigate the WMI stuff. ...

What does AllowLocation="true" do in System.Web section of Web.Config?

We have a .NET 2.0 application which we normally run on IIS6, and used to run fine on IIS7, but recently after installing SP1 for Vista IIS7 seems to be choking on a line in the Web.Config file: <system.web AllowLocation="true"> Is it safe to remove the AllowLocation attribute? What does this attribute do? ...

How do you make StackWalk64() work successfully on x64?

I have a C++ tool that walks the call stack at one point. In the code, it first gets a copy of the live CPU registers (via RtlCaptureContext()), then uses a few "#ifdef ..." blocks to save the CPU-specific register names into stackframe.AddrPC.Offset, ...AddrStack..., and ...AddrFrame...; also, for each of the 3 Addr... members above, i...

Launching a registered mime helper application

I used to be able to launch a locally installed helper application by registering a given mime-type in the Windows registry. This enabled me to allow users to be able to click once on a link to the current install of our internal browser application. This worked fine in Internet Explorer 5 (most of the time) and Firefox but now does not ...

Auto-Hide taskbar not appearing when my application is maximized

My application draws all its own window borders and decorations. It works fine with Windows taskbars that are set to auto-hide, except when my application window is maximized. The taskbar won't "roll up". It will behave normally if I have the application not maximized, even when sized all the way to the bottom of the screen. It even w...

Can you (and should you) straddle both worlds (Linux and Windows)

I am programmer from a Linux/Unix background with experience in Perl, Java, Sybase, Oracle. I recently switched jobs and now I am working on C#, ASP.NET, Classic ASP and SQL Server. Do you think you have to pick your camp and stick to it, or can you effectively live\work in both worlds? Comments from people with experience would be he...

How do I programmatically show or hide the Outlook envelope icon?

For example, how do I show or hide the Outlook envelope icon from an Outlook Rule? The envelope icon option is set by going to: Tools -> Options... E-mail Options Advanced E-mail Options Show an envelope icon in the notification area The reason why I say programmatically is because none of the standard Rule actions apply. (The "Cle...

How to determine whether a drive is network mounted?

I am searching for all drives and their contents. I don't want to search network drives. How can I determine if a given drive is network mounted? What I would want further is to get similar information one gets using NET USE command? ...

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to apache called site1.local, site2.local etc, and have them all resolve to localhost, while apache serves a different site accordingly. I am on Windows XP. I tri...

batch scripting iterating over files in a directory

How could I iterate over each file in a directory using for? And how could I tell if a certain entry is a directory or if it's just a file? ...

Saving 'tree /f /a" results to a textfile with unicode support

I'm trying to use the tree command in a windows commandline to generate a text file listing the contents of a directory but when I pipe the output the unicode characters get stuffed up. Here is the command I am using: tree /f /a > output.txt The results in the console window are fine: \---Erika szobája cover.jpg Eri...