Page 1 of 1

CMD always starts at last path on C drive

Posted: 16 Feb 2011, 13:24
by Sot23
After replacing my computer by a newer model I can't start CMD/BAT files anymore from other drives than C.
In addition to that all local references within CMD/BAT files, which should lead to another drive than C, are always leading to the last used path on the C drive.

Examples:
  • executing a CMD/BAT file stored at C containing e.g. a copy command to ., which actually is another drive, copies the source to the last used path on C
  • trying to extract the content from a 7z archive on d:\blabla\dummy.7z using the command line version of 7z doesn't find the archive, because it searches in the last used path on C
  • simply clicking the Command Shell Button also opens CMD at the last used path on C, while having different drives in both panels
This is a really strange behaviour and never happend before at similar exchange jobs (Salamander registered since 2003 and never ever had any serious issue).
Yes, I already reinstalled Salamander, and yes, I already compared the files from as254.exe with the installed files bytewise (for which I also used the 7z command mentioned above).

Any idea?
sot23

Re: CMD always starts at last path on C drive

Posted: 16 Feb 2011, 17:38
by Jan Rysavy
Which Windows version are you running?

Re: CMD always starts at last path on C drive

Posted: 16 Feb 2011, 17:45
by therube
Is "." (current directory) pointing to a UNC path?
If so, you need to map a drive letter to that UNC path, then "." will work successfully.

(I believe there is a method around that - to allow UNC paths, but it may bring along its own problems.)

Re: CMD always starts at last path on C drive

Posted: 16 Feb 2011, 22:57
by Ether
Try switching to another drive inside the prompt (type in D: and press Enter).

EDIT] After re-reading your post, I think that switching to another disk is not the problem, only that the prompt always starts in C:. You may want to try digging around the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor, if there is anything of interest.