DOS does not have complete path to a file

  • Thread starter Thread starter Jim Richards
  • Start date Start date
J

Jim Richards

Hello. In trying to write a Batch File to copy Outlook.pst from my C: HD to
my E: HD, I found out that I could not access this file in DOS. I have
placed two graphics on my website. The Windows Explorer Path is shown in
http://home.satx.rr.com/jimwrichards/images/WinExp.gif
and the DOS Path is shown in
http://home.satx.rr.com/jimwrichards/images/DOS1.gif
Notice that in DOS when I get to the directory "Jim Richards" there is NO
"Local Listings" shown in the dir that I display there BUT it is shown in
the WinExp.gif. This prevents me from writing the Batch File since I cannot
access the Outlook.pst
file in DOS. Can anyone explain why DOS does not have the complete path to
the Outlook.pst file? Is there any workaround? Thanks in advance, Jim.
 
Jim said:
Hello. In trying to write a Batch File to copy Outlook.pst from my C: HD to
my E: HD, I found out that I could not access this file in DOS. I have
placed two graphics on my website. The Windows Explorer Path is shown in
http://home.satx.rr.com/jimwrichards/images/WinExp.gif
and the DOS Path is shown in
http://home.satx.rr.com/jimwrichards/images/DOS1.gif
Notice that in DOS when I get to the directory "Jim Richards" there is NO
"Local Listings" shown in the dir that I display there BUT it is shown in
the WinExp.gif. This prevents me from writing the Batch File since I cannot
access the Outlook.pst
file in DOS. Can anyone explain why DOS does not have the complete path to
the Outlook.pst file? Is there any workaround? Thanks in advance, Jim.
I don't see any problems. File or path names containing spaces have to be
quoted. If you want to have the batch universal you can use the environment
variable USERPROFILE. So this should do:

@echo off
set SrcP="%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook"
xcopy "%SrcP%\Outlook.pst" "E:\destination path\"
 
Jim said:
Hello. In trying to write a Batch File to copy Outlook.pst from [ ]
that in DOS when I get to the directory "Jim Richards" there is
NO "Local Listings" shown in the dir that I display there BUT
[ ]

You used DIR instead of DIR /a (or dir /ah).
"\Local Settings\" is usually set +H (Hidden) by default.

Also, I suspect you mean the Windows commandline (CMD.EXE)
interface and not actually an operating system ("DOS").
I don't see any problems. File or path names containing spaces
have to be quoted. If you want to have the batch universal you
can use the environment variable USERPROFILE. So this should do:

One might also use %appdata% for part of the path if still logged
in with the same account at the time.
 
You are right Mark V and thanks for your response. I did mean the
cmdprompt.admin. I still have my original DOS 6.22 Installation disk. By the
way, I use XP Pro SP2 but could not find a user group for XP so I used the
Win2000 User Group. Is there a XP User Group for DOS? TIA, Jim

Mark V said:
Jim said:
Hello. In trying to write a Batch File to copy Outlook.pst from [ ]
that in DOS when I get to the directory "Jim Richards" there is
NO "Local Listings" shown in the dir that I display there BUT
[ ]

You used DIR instead of DIR /a (or dir /ah).
"\Local Settings\" is usually set +H (Hidden) by default.

Also, I suspect you mean the Windows commandline (CMD.EXE)
interface and not actually an operating system ("DOS").
I don't see any problems. File or path names containing spaces
have to be quoted. If you want to have the batch universal you
can use the environment variable USERPROFILE. So this should do:

One might also use %appdata% for part of the path if still logged
in with the same account at the time.
@echo off
set SrcP="%USERPROFILE%\Local Settings\Application
Data\Microsoft\Outlook" xcopy "%SrcP%\Outlook.pst"
"E:\destination path\"
 
Mark said:
In microsoft.public.win2000.cmdprompt.admin, Matthias Tacke wrote:
One might also use %appdata% for part of the path if still logged
in with the same account at the time.
But %APPDATA% points to
"C:\Documents and Settings\Jim Richards\Application Data"
and not to
"C:\Documents and Settings\Jim Richards\Local Settings\Application Data"

Even if you can use
"%APPDATA%\..\Local Settings\Application Data\Microsoft\Outlook"
it seemed more logical to me to use the shorter "%USERPROFILE%"
 
But %APPDATA% points to
"C:\Documents and Settings\Jim Richards\Application Data"
and not to
"C:\Documents and Settings\Jim Richards\Local
Settings\Application Data"
[ ]

Ah yes. Must have been hidden. ;-)
I agree with your usage.
 
Jim Richards said:
Hello. In trying to write a Batch File to copy Outlook.pst from my C: HD to
my E: HD, I found out that I could not access this file in DOS. I have
placed two graphics on my website. The Windows Explorer Path is shown in
http://home.satx.rr.com/jimwrichards/images/WinExp.gif
and the DOS Path is shown in
http://home.satx.rr.com/jimwrichards/images/DOS1.gif
Notice that in DOS when I get to the directory "Jim Richards" there is NO
"Local Listings" shown in the dir that I display there BUT it is shown in
the WinExp.gif. This prevents me from writing the Batch File since I cannot
access the Outlook.pst
file in DOS. Can anyone explain why DOS does not have the complete path to
the Outlook.pst file? Is there any workaround? Thanks in advance, Jim.

From your two graphics, it appears you have two files named outlook.pst
however, the reason you do not see the "Local Settings" folder is because it
has the hidden attribute set. To see hidden folders you need to include the
/A switch with the DIR command to display all attributes.

dir /a

Use the DIR/? command for further DIR help.

In addition to the information to enclose paths with spaces in quotes, to
get the real path of a file shown in explorer...

Open a command prompt window and type echo{space} then drag the file from
explorer into the command prompt window. The echo prevents accidental
execution of the file dropped but you can now copy the full path from the
command prompt window.
 
Jim Richards said:
You are right Mark V and thanks for your response. I did mean the
cmdprompt.admin. I still have my original DOS 6.22 Installation disk.

Even though I'm a pack rat, and also have a fond affection for 6.22 (one of
the better versions of good, old, *real* DOS), I no longer have hardware I
can even install it on. If you can install it on your XP machine, I'd say
you are overdue for a hardware upgrade ;-)

Anyway, if you installed DOS on a FAT drive in your XP system, it would be
unable to see ANY files on your C: drive (which, if not formatted as NTFS,
is a mistake).
By the way, I use XP Pro SP2 but could not find a user group for XP so
I used the Win2000 User Group. Is there a XP User Group for DOS? TIA, Jim

Ummm, there is no XP NEWS group for DOS, because if you are running XP, you
are not running DOS.

If you want a news group that can answer your questions about batch
programming on windows XP, then your best choice is likely this newsgroup
(i.e. microsoft.public.win2000.cmdprompt.admin). You will occasionally find
useful info at microsoft.public.windows.server.scripting, however, that
group is not language specific, including PowerShell and VBScript.

I hope you did not take offense at my response yesterday in your "pausing
batch file execution" thread; my only concern with your terminolofy is that
a lack of conciseness on your part will probably only continue to cause you
to problems as it can lead to further misunderstanding.


/Al
Mark V said:
Jim Richards wrote:
Hello. In trying to write a Batch File to copy Outlook.pst from [ ]
that in DOS when I get to the directory "Jim Richards" there is
NO "Local Listings" shown in the dir that I display there BUT
[ ]

You used DIR instead of DIR /a (or dir /ah).
"\Local Settings\" is usually set +H (Hidden) by default.

Also, I suspect you mean the Windows commandline (CMD.EXE)
interface and not actually an operating system ("DOS").
I don't see any problems. File or path names containing spaces
have to be quoted. If you want to have the batch universal you
can use the environment variable USERPROFILE. So this should do:

One might also use %appdata% for part of the path if still logged
in with the same account at the time.
@echo off
set SrcP="%USERPROFILE%\Local Settings\Application
Data\Microsoft\Outlook" xcopy "%SrcP%\Outlook.pst"
"E:\destination path\"
 
You guys are all just great. Thanks Todd, for your statement: "Open a
command prompt window and type echo{space} then drag the file from explorer
into the command prompt window. The echo prevents accidental execution of
the file dropped but you can now copy the full path from the command prompt
window." This works just fine. Thanks to all of you for your very fine
comments and advice. Jim.
 
Back
Top