#1 13 May 2014 23:37

carlos
Member
From: Chile
Registered: 04 Nov 2008
Posts: 244
Website

[Undocumented] New info for Type command, Dpath is not deprecated

Simon, Dpath command is not deprecated, it should be appear on the documentation.

I found that type command have this behavior:

type fileName

if fileName not exist in the current directory, type would search it in the DPATH environment directory, and if the file exist in that directory it would assume that you refer to it.

look this example:

C:\injection>echo hello>msg.txt

C:\injection>dir /b /a
msg.txt

C:\injection>type msg.txt
hello

C:\injection>cd \good

C:\good>dir /b /a

C:\good>type msg.txt
The system cannot find the file specified.

C:\good>dpath c:\injection

C:\good>set dpath
DPATH=c:\injection

C:\good>type msg.txt
hello

C:\good>dir /b /a

C:\good>

Last edited by carlos (13 May 2014 23:51)

Offline

#2 14 May 2014 04:25

foxidrive
Member
Registered: 04 Apr 2013
Posts: 339

Re: [Undocumented] New info for Type command, Dpath is not deprecated

I confirm that behaviour in Windows 8.1 32 bit.

c:\Files>type au.txt
The system cannot find the file specified.

c:\Files>dpath d:\nocopy

c:\Files>type au.txt
aaa
bbb

Last edited by foxidrive (14 May 2014 04:28)

Offline

#3 14 May 2014 17:04

Giacomo
Member
From: Italy
Registered: 20 Oct 2011
Posts: 40

Re: [Undocumented] New info for Type command, Dpath is not deprecated

Aren't spaces allowed?

Microsoft Windows XP [Versione 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings>MD 1

C:\Documents and Settings>MD 2

C:\Documents and Settings>CD "C:\Documents and Settings\1"

C:\Documents and Settings\1>ECHO.A>B

C:\Documents and Settings\1>DIR/A/B
B

C:\Documents and Settings\1>TYPE B
A

C:\Documents and Settings\1>CD "C:\Documents and Settings\2"

C:\Documents and Settings\2>DIR/A/B

C:\Documents and Settings\2>TYPE B
Impossibile trovare il file specificato.

C:\Documents and Settings\2>DPATH "C:\Documents and Settings\1"

C:\Documents and Settings\2>SET DPATH
DPATH="C:\Documents and Settings\1"

C:\Documents and Settings\2>TYPE B
Impossibile trovare il file specificato.

C:\Documents and Settings\2>DIR/A/B

C:\Documents and Settings\2>

Offline

#4 14 May 2014 18:42

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 873
Website

Re: [Undocumented] New info for Type command, Dpath is not deprecated

While a deprecated software feature remains in the software its use may raise warning messages recommending alternative practices; deprecated status may also indicate that feature will be removed in the future. Features are deprecated rather than immediately removed to provide backward compatibility and give programmers time to bring affected code into compliance with the new standard. https://en.wikipedia.org/wiki/Deprecation

Dpath seems to have its roots way back in OS/2, but I can't find any links to support it being a current supported command.
http://homepage.ntlworld.com/jonathan.d … html#DPATH

dpath /? returns help for a different command (APPEND)

Append has been dropped from 64 bit versions of Windows, so even while dpath /? gives the syntax (for append), none of it works.

Offline

#5 14 May 2014 19:20

carlos
Member
From: Chile
Registered: 04 Nov 2008
Posts: 244
Website

Re: [Undocumented] New info for Type command, Dpath is not deprecated

Simon. My test is under a windows 8 64 bits.
Also, the feature I tested ok on windows xp 32 bits.

@giacomo: the spaces are allowed, but the quotes are not allowed. the ; is considered a separator.

look this example:

C:\a test>echo hi>f.txt

C:\a test>dir /b /a
f.txt

C:\a test>type f.txt
hi

C:\a test>cd ..

C:\>cd batch

C:\batch>dir /b /a

C:\batch>type f.txt
The system cannot find the file specified.

C:\batch>dpath "c:\a test"

C:\batch>dpath
DPATH="c:\a test"

C:\batch>type f.txt
The system cannot find the file specified.

C:\batch>dpath c:\a test

C:\batch>type f.txt
hi

C:\batch>md c:\a

C:\batch>echo bye>c:\a\f.txt

C:\batch>type f.txt
hi

C:\batch>dpath c:\a;c:\a test;

C:\batch>type f.txt
bye

C:\batch>

Offline

#6 14 May 2014 20:40

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 421

Re: [Undocumented] New info for Type command, Dpath is not deprecated

@carlos -  pretty interesting!!! Is type the only command that relies on DPATH ?

@giacomo - DPATH syntax is exactly the same as PATH (it only sets DPATH variable instead of PATH). They even give the same output id DPATH/PATH is not defined.

APPEND command used to be the "official" way for editing of the DPATH variable (despite it's available in 32b versions of windows it does not work)

As ss64.com/nt contains a lot of undocumented information/tricks/.. and I see it as a more reliable source than microsoft's documentation I won't mind if this feature is at least mentioned in TYPE page :-) .

Last edited by npocmaka (14 May 2014 20:41)

Offline

#7 14 May 2014 21:00

Giacomo
Member
From: Italy
Registered: 20 Oct 2011
Posts: 40

Re: [Undocumented] New info for Type command, Dpath is not deprecated

Thanks carlos and npocmaka!

Offline

#8 14 May 2014 21:38

carlos
Member
From: Chile
Registered: 04 Nov 2008
Posts: 244
Website

Re: [Undocumented] New info for Type command, Dpath is not deprecated

Is interesting that on windows xp.

Append is a external command append.exe
and append.exe /? have the same output that dpath /?
and do the same, but I think that append was left some time for compatibility, and dissapear on the 64 bits windows, but append.exe
not dpath that is internal command of cmd.exe

dpath is a internal command.
append.exe is a 16 bit exe.

on windows 8 64 bits dpath command as internal command is present, but append.exe is missing.

@npocmaka, seems that are other feature that use DPATH environment variable.

Last edited by carlos (14 May 2014 22:40)

Offline

#9 22 May 2014 00:19

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 873
Website

Re: [Undocumented] New info for Type command, Dpath is not deprecated

I have added a brief mention of dpath on the PATH page here: http://ss64.com/nt/path.html#dpath

Offline

Board footer

Powered by FluxBB