views:

299

answers:

2

Hi. My Procedure last day as below

Click Start, Run and type Regedit.exe Navigate to the following branch:

HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor

In the right-pane, double-click Autorun and set the startup folder path as its data, preceded by “CD /d “. If Autorun value is missing, you need to create one, of type REG_EXPAND_SZ or REG_SZ in the above location.

Example: To set the startup directory to D:\learning\perl, set the Autorun value data to CD /d D:\learning\perl

Then I clicked Start, run and type cmd. It successfully. I could do perl practice more conveniently now.

But today, I find when I try to build my Visual Studio 2005 solution which included some Pre-build event Command like this: perl.exe MyAppVersion.pl perl.exe AttrScan.pl It doesn't work. Show error: can't find the path. I check the environment variable setting and find the variable-path and it's value-c:\perl\bin\; still exist.

Finially, I try to removed the Regedit.exe configuration "Autorun" value and test again. The issue fixed.

I only changed the default startup directory for cmd.exe command. Why the pre-build event perl command was impacted? (I am using winxp and activePerl 5.8)

+3  A: 

It looks like Visual Studio is using cmd.exe to execute perl.exe. This is not unusual, and changing the registry as you have done can also impact other programs, not just Visual Studio.

Just do the CD /D manually or create a link to cmd.exe that sets d:\learning\perl as the starting directory.

jdigital
A: 

I have noticed on windows 7 x64 that jdigitals suggestion to create a link that sets d:\learning\perl as the starting directory does not work. Cmd.exe will not take that as a legal parameter. Also, in Windows 7 the key refered to by brian d foy does not exist. So on windows 7 it just doesn't seem possible to get a cmd to start in the right directory if it is not on the system volume (C:). So as far as i'm concerned this isn't solved.

Whatdoesitwant