July 25, 2003
Windows CMD autorun
Here's a useful hack. Edit the registry on your Windows 2000 (or XP) box so that it will automatically do something when you open a command prompt.
Find the HKEY_CURRENT_USER\Software\Microsoft\Command Processor subtree. Add a REG_SZ value to it. Name that string Autorun and enter the value CD \somedirectory but replace somedirectory with a path that's appropriate on your machine. I've got a \temp directory so I use that path. Also note you can have it perform multiple commands using a syntax like "D: & CD \temp" and that will change to the D: drive and then switch into the D:\temp directory.
Note that you can add this value in the [HKEY_USERS].Default or even the [HKEY_LOCAL_MACHINE] subtrees. Add it to the .Default tree and any new local users to the box would get it added into their subtree. For folks using Active Directory and profiles this probably wouldn't be very useful. There are ways, using domain profiles, to accomplish this but they're a bit more involved. Adding it to the Local Machine substree has the effect of forcing the setting for anyone using the box. I'm not sure that's such a good idea.
This could be configured into a .reg file that users could simple double-click and get it automagically loaded into their subtree. Since the directory pathname is unlikely to be the same on your machines as mine I'm not going to post one here. Besides, this is one of those situations where knowing what you're doing IS IMPORTANT.
As always, no guarantees here folks, you get this wrong and there's no telling what damage you'd be causing to your machine. Proceed with care.
When i use cmd command prompt it should automatically go to the set path.it's not happening like that.Inorder to get that what are setting.
Posted by: Syed on September 29, 2003 09:50 PM






