DOS program needs a DOS path to desktop

DOS program needs a DOS path to desktop

Post by usd » Sat, 16 Sep 2006 11:12:18


I am wrtting a DOS program that
will place a text file on my desktop.
The path to my desktop is

C:\Documents and Settings\Owner.YOUR-E4DEF3FEB4\Desktop

How can I abbreviate this for DOS usage ?
Is there a way to specify a general path to anyones desktop ????



Len
 
 
 

DOS program needs a DOS path to desktop

Post by William J. » Sat, 16 Sep 2006 11:56:08


I've got C code somewhere around here which allows real mode DOS programs to
handle long file names when running under Windows and falls back to 8.3 names
under real DOS. If it would help, I can dig it up and send a copy.


Perhaps an environment variable that gave the path to the current users
desktop? I'll take a look at work tomorrow.

- Bill

 
 
 

DOS program needs a DOS path to desktop

Post by pete » Sat, 16 Sep 2006 14:04:29

In article < XXXX@XXXXX.COM >
XXXX@XXXXX.COM writes:


You could try SUBST e.g.

subst k: C:\Documents and Settings\Owner.YOUR-E4DEF3FEB4\Desktop

and then get your DOS program to write to K: (or whatever).


Don't know. If there is an environment variable available that
has been set by Win (e.g. "desktop"), you could try

subst k: %desktop%

Pete

NB. Drive letters set by SUBST are sticky, which might not be
what you want in which case you could wrap your program in a
batch file, like

subst z: whatever
yourdosprog.exe z:
subst z: /d

--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."
 
 
 

DOS program needs a DOS path to desktop

Post by usd » Sat, 16 Sep 2006 14:53:11

HI all thanks for the info ...I just found a solution
I have discovered a few yrs ago
I can use c:\DOCUME~1\OWNER~1.YOU\desktop\file.txt
Len
 
 
 

DOS program needs a DOS path to desktop

Post by Robert Rie » Sat, 16 Sep 2006 16:40:38


XXXX@XXXXX.COM schrieb:


But this won't work on all PCs!

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!
 
 
 

DOS program needs a DOS path to desktop

Post by BEN RITCHE » Sat, 16 Sep 2006 17:30:36

FamilyNet International Newsgate

* An ongoing debate between XXXX@XXXXX.COM and All rages on ...

| U> I am wrtting a DOS program that
| U> will place a text file on my desktop.
| U> The path to my desktop is

| U> C:\Documents and Settings\Owner.YOUR-E4DEF3FEB4\Desktop

| U> How can I abbreviate this for DOS usage ?

Check the SFNs but C:\DOCUME~1\OWNER~1.YOU\DESKTOP should work ...

| U> Is there a way to specify a general path to anyones desktop ????

No ... AFAIK (%SystemRoot%\Desktop may work anyway <g>)

--
Be well :^)

: Ben aka cMech http://www.yqcomputer.com/
:
+ WildCat! Board 24/7 +1-337-232-4155 any BAUD 8,N,1
--- GoldEd+/DOS v1.1.5cM
# Origin: FamilyNet - The Positronium Repository (8:8/337)

FamilyNet <> Internet Gated Mail
http://www.yqcomputer.com/
 
 
 

DOS program needs a DOS path to desktop

Post by Puckdroppe » Sun, 17 Sep 2006 01:28:03


@familynet-international.org:


%systemRoot% points to C:\windows. In post-DOS derived Windows (I.E. NT-
based) your desktop folder is not in the Windows directory.

OTOH, it may work due to a compatibility "feature" Windows sometimes puts
in. I just tried copying a file to %systemroot%\desktop and it didn't
work. (Actually it created a file calle desktop in C:\windows.)

Puckdropper
--
Wise is the man who attempts to answer his question before asking it.

To email me directly, send a message to puckdropper (at) fastmail.fm
 
 
 

DOS program needs a DOS path to desktop

Post by Charles Dy » Sun, 17 Sep 2006 01:39:57


%UserProfile%\desktop might be a better bet. (Though I don't think in works
in older versions of NT. Pre-2000?)

A newsgroup devoted to Windows NT might be a better source of information
about NT than a newsgroup devoted to DOS, BTW.

--
Charles Dye XXXX@XXXXX.COM
 
 
 

DOS program needs a DOS path to desktop

Post by BEN RITCHE » Sun, 17 Sep 2006 08:32:58

FamilyNet International Newsgate

* An ongoing debate between Puckdropper and All rages on ...

| P> %systemRoot% points to C:\windows. In post-DOS derived Windows (I.E.
| P> NT- based) your desktop folder is not in the Windows directory.

Aha...it works on my 98SE system but not XPH or Vista ...

--
Be well :^)

: Ben aka cMech http://www.yqcomputer.com/
:
+ WildCat! Board 24/7 +1-337-232-4155 any BAUD 8,N,1
--- GoldEd+/DOS v1.1.5cM
# Origin: FamilyNet - The Positronium Repository (8:8/337)

FamilyNet <> Internet Gated Mail
http://www.yqcomputer.com/
 
 
 

DOS program needs a DOS path to desktop

Post by buck huffm » Mon, 18 Sep 2006 10:59:59


worth noting is the fact that in winXP you my place a file in:

C:\Documents and Settings\All Users\Desktop

which, if I'm correct, will then appear on everybody's desktop.
in win9x it's

c:\windows\desktop

or something like that. I'm running Linux right now so I can't
verify any of that. but it sounds right.

buck