Showing posts with label XP. Show all posts
Showing posts with label XP. Show all posts

Saturday, March 20, 2010

Win XP Explorer Context Menu: Open and Run in CMD

From time to time I still have to use software running in DOS command.com-like window. If such a program was started from Explorer, the cmd window would disappear with all the information as soon as the program has ended. To avoid that it is necessary, first, to start command window by running cmd.exe, then change directory to the one you need to run the program from and finally start the program. Luckily, there are ways to speed it up.

A partial solution for the problem would be at least an ability to open command window in a required directory and there are many known ways to do that. For example, Add Command Prompt Here Shortcut to Windows Explorer has a comprehensive list of such variants. My choice was to edit Windows registry file.

Note: Editing the registry file is dangerous and good practice is to try every change you are going to do in a virtual machine first.

Copy the following text into a text file:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Open in cmd]
@="Open in cmd"

[HKEY_CLASSES_ROOT\Directory\shell\Open in cmd\command]
@="cmd.exe /k cd %1"
save the file with "reg" extension, then double click it to install the new keys. You can download the OpenDirInCmd.reg file ready for using.

In addition, I created an option which is slightly different from the previous one. It opens command prompt window by right click on any file in a directory:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Open in cmd]
@="Open in cmd"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Open in cmd\command]
@="cmd.exe /k"
It's in the file OpenInCmd.reg.

A close variant for running an executable file in cmd window is "Send to Toys" from http://www.gabrieleponti.com. It adds an option "Command Prompt" to the context menu "Send To". Using it on exe file ends up with open cmd window in corresponding directory and the chosen exe file name typed in the prompt, so the only move left to run the program is to press Enter. I personally decided to mess a little bit directly with the registry:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\exefile\shell\Run in cmd]

[HKEY_CLASSES_ROOT\exefile\shell\Run in cmd\command]
@="cmd.exe /k \"%1\""
I put it in the file RunInCmd.reg. Right click on an exe file, then choose "Run in cmd" option - it opens cmd window, runs the program from its directory and the cmd window stays open after the program termination:


Similarly for batch files:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\batfile\shell\Run in cmd]

[HKEY_CLASSES_ROOT\batfile\shell\Run in cmd\command]
@="cmd.exe /k \"%1\""
I saved it in the file RunBatInCmd.reg.

One thing which can be helpful: in order to see what really comes with the parameter "%1" just insert "echo" command before it:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\exefile\shell\Run in cmd]

[HKEY_CLASSES_ROOT\exefile\shell\Run in cmd\command]
@="cmd.exe /k echo \"%1\""
It's in the file RunInCmdecho.reg.

So the main problem is solved, but for the sake of curiosity I'm still looking for a context menu option when right click is done on empty space in Explorer - tweaking "Directory\Background\..." in the registry has not helped yet.
Read more...

Sunday, January 24, 2010

Scheduled Chimes in Windows XP and Vista

I like quarter of an hour chimes - they give a good reference of the course of time. There are some computer programs available which do the task, but it's a pity I was not able to find a nice one for Windows XP which would be free of serious disadvantages.

Some of the programs I tried made latent attempts to connect to unknown internet IP through FTP port for unknown purpose - thanks to Comodo firewall, it caught them all. Others took abnormally big memory after a couple hours of running (memory leak?). Nevertheless the task is very simple to solve it by means of tools already available in Windows: scheduling and playing sound.

One of the easiest way to play a WAV sound file from command line is to use "Sound Recorder":

C:\WINDOWS\system32\sndrec32.exe /play /embedding /close "D:\Misc\Chimes\chime.wav"

The option "/embedding" keeps the program running in background, the other keys make it play the chime.wav file and then close.

Now the task should be scheduled: go to menu Start/Control Panel then open Scheduled Tasks/Add Scheduled Task and set it, for example, like this:









That's it for Windows XP - choose a ding-dong sound pleasant to your ear and set up the scheduled task to play it. More complicated variants when, for instance, it plays a different sound for a different quarter can be done easily too.

In Vista sndrec32.exe was replaced with SoundRecoder.exe which does not play WAV files, so the way I made it working was:
  1. to copy sndrec32.exe from an XP machine to the box with Vista;

  2. run it for the first time as Administrator to let it get registered;

  3. start Task Scheduler from Start/All Programs/Accessories/System Tools/ and setup the scheduled task similarly to the procedure in XP.
Read more...

Friday, October 9, 2009

Comodo's cmdagent.exe Seized CPU - Bad Virus Database

This week Comodo stepped on a rake. They released a new virus database and cmdagent.exe service went completely crazy: it took about 100% of CPU time and made computers totally useless.

The cure was to start computer is Safe mode (press F8 during boot) and copy the installation default virus database bases.cav from
C:\Program Files\COMODO\COMODO Internet Security\repair
to the working directory
C:\Program Files\COMODO\COMODO Internet Security\scanners
then update the database again to the corrected new version.

Comodo had the problem rectified pretty quickly but still those who got into the trouble had to apply the fix manually. Hopefully it was the last time when Comodo accidentally released not completely tested update and they will be more careful in the future.
Read more...

Thursday, September 17, 2009

Firewalls for Windows - Free for Personal Use

I've decided to write in the post about some of my experience with different firewalls for Windows. I needed a firewall with such features as easy and detailed management, possibility to work via remote access with hardware and virtual computers, for both 32- and 64-bit Windows versions, XP and Vista. Here are what I used and my impressions from that.
  1. Windows firewall comes along with both 32- and 64-bit OS versions. XP firewall does not control outbound traffic what is not acceptable for me, Vista firewall does, but its setup is a nightmare - it does not show what process is really sending something out. Since it is not clear what is going on and corresponding rules should be defined manually it appears very difficult to set up the firewall. From what I read, Microsoft put a proper control over the firewall into Windows Live OneCare and there was a hope that soon it would become free of charge, but it is still not - the price is $49.95.

  2. ZoneAlarm is very easy firewall to deal with. I've been using it for a couple of years. It shows outgoing processes and asks whether you want it to be blocked or pass through, once or forever - this is the very right way for firewall to help in setting the rules. At present ZoneAlarm seems to have a free for personal use firewall with both 32- and 64-bit versions for Vista, XP still gets it as 32-bit only: http://www.zonealarm.com/security/en-us/system-requirements-zonealarm-products.htm. ZoneAlarm disadvantages are:

    1. not very detailed rule settings;

    2. a firewall alert window is not clickable via VNC remote session, what made the remote session very conditional – if firewall shows an alert it is necessary to go to that specific computer and click the firewall pop-up window button.

    Because of those drawbacks I decided to move to another firewall about a year ago.

  3. Comodo - I started using Comodo about a year ago when it was a firewall only (now it comes along with antivirus and defense). I needed more control over the function than I could get from free Zone Alarm and Comodo offered that. Later, when I got a media-PC with Vista x64, Comodo again was one of not many free for personal use supporting 64-bit Windows and the most advanced and rich one among them in features and depth of control. To be honest, at that time Comodo had two main disadvantages from my point of view:

    1. It was too annoying - it required confirmation for every step of a process carrying out. It was educational to see what is going on under the hood, but so many alerts were pretty disturbing (although after setting a permanent rule, of course, it calmed down);

    2. Somehow it blocked remote NX session from one network computer to a virtual Linux computer running on another x64 Vista network machine (pretty specific case I think, but I needed that). Everything like Internet and local network access from the virtual computer was working fine, but not the NX session - and it was the Comodo firewall on the Vista host which blocked the connection.

    That was in the past, the current versions are free from the both of the drawbacks and work very stable on my different Windows computers: 32- or 64-bit OS, different hardware brands; there is no problem with NX or any other type of remote access to hardware or virtual machines I use.

  4. Sphinx - I used it at the time when Comodo had the problems I described above and there were very limited number of available 64-bit firewalls free for personal use. Sphinx was one of them. As its description suggests Sphinx is not a complete firewall, it is a control over the existing Windows firewall and Sphinx compensates the lack of management in it: Sphinx generates pop-up alerts for traffic and sets the firewall rules according to a user choice. It's a pity the rule settings in the free version are very poor: just "Allow" or "Block", all rules are in the same general zone - more detailed control is available only with the commercial version of Sphinx. Nevertheless it did the job.
Nowadays much more firewalls are available for free for personal use: Ashampoo, PCTools, Outpost, etc. - just search. The choice of x64 versions has become better too. Some of them, Comodo, for example, come in a bundle with other protection tools as antivirus and malware defense. At present I put Comodo in charge of security on all of my Windows computers and it seems it's doing the job very well: I have not noticed any system or application slowdown, antivirus is a little bit too alert in "Heuristic" mode (jumps up on some of safe programs), but it's a rare case and it can be easily pacified. Comodo also offers commercial versions of firewalls and many other network security products for different cases - if interested you can check it out following the sponsor link:

Comodo Internet Security Pro
Read more...

Saturday, July 25, 2009

Windows XP and Vista - Account Pictures

The default collection of pictures for user accounts can be found in the following folders:

in Vista - C:\ProgramData\Microsoft\User Account Pictures\Default Pictures\

in XP - C:\Documents and Settings\All Users\Application Data\Microsoft\User Account Pictures\Default Pictures\

The pictures are BMP, in Vista they are of 128x128 pixels and in XP - 48x48 pixels.
Read more...

Windows XP and Vista - Map Network Drive with Batch file

For security reason it is a good practice to share specific folders on network with authorized access. Unfortunately Windows sharing has an unpleasant feature that if there is an established connection from one user to a network computer (sharing server), connection for another user from the same machine to the same server will be rejected. For instance if there are two shared folders: one for User1 and another for User2,- and User1 has already connected, in order to switch to User2 it is necessary to close the User1 network mapping first then reconnect as User2. Not a big deal to do it once in a while, just go to Windows Explorer's Tools\"Disconnect Network Drive" then "Map Network Drive", however switching back and forth becomes annoying very quickly. A possible solution is to use a batch file to automate the switching.

The command to handle that is "net use..." with different options. A description of the command can be found on Microsoft website: Net use .

The two batch files can do the job:
  1. User1.bat has the following lines:

    net use * /delete /yes
    net use x: \\NetServerName\SharedFolder *
    /user:NetServerName\User1

  2. User2.bat :

    net use * /delete /yes
    net use y: \\NetServerName\SharedFolder *
    /user:NetServerName\User2
The first command "net use * /delete /yes" in the both files deletes all existing connections. The key "/yes" is not documented in the official Microsoft description, but it works as a default response to the command prompt question [Y/N].

The second command sets up new mapping to the specified shared folder from the specified user. An asterisk (*) at the password key position makes the command ask for the password.

I put shortcuts to the batch files on the desktop and switching between these shared folders became trivial.
Read more...

Tuesday, July 21, 2009

Windows Filesharing Error - Not Enough Server Storage

Recently I bumped into a problem with file-sharing - an attempt to copy files from an XP machine to a Vista computer ended up with the error "Not enough server storage". Rebooting all the computers did not help to resolve the issue. As Microsoft suggests the problem is related to a small value for IRPStackSize parameter on the server side computer.

On the server computer
start Regedit.exe as Administrator, go to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameter". From there change IRPStackSize to a value in range from 16 to 50. I made it 25 decimal (or 19 in hex). If the parameter IRPStackSize does not exit, create it as DWORD Value. Reboot the computer and check if it helps. If still not, you can try a bigger value, reboot and check again. I changed the value on all my network computers to 25 - since then the problem has not surfaced yet.
Read more...

Monday, July 20, 2009

Control Startup Applications in Windows XP and Vista

To control which applications should be run at startup a general working both for XP and Vista way is using MSCONFIG.EXE: switch to the Startup tab and just unselect the items you do not want to be starting automatically.

In Vista there is another way via Windows Defender: start it from Control Panel, in Window Defender click Tools, then Software Explorer, choose Category "Startup Programs", you can Disable programs in the list to prevent them from starting.

The easiest way to make a program starting automatically is to add its shortcut to the "All Programs"\Startup folder.
Read more...