0

Hi everyone! I am making a simple chat program in batch (it doesn't use the net send command). It consist of a main DOS window that you chat with called PM, a .txt file called Log that stores what you say, and a DOS window called PM LOG that prints on the screen what is in the Log.txt file (so you don't have to keep opening it). So, my problem is that whenever I use the TYPE command, I can't specify the location. But if I just say TYPE Log.txt, it will print out Log.txt thats in the folder that PM Log.bat is in. For example PM Log.bat:

some script here..blah blah
TYPE C:\Documents and Settings\Owner\My Documents\Log.txt

then I get this error:

Access is denied.
Error occurred while processing: C:\Documents.
The system cannot find the file specified.
Error occurred while processing: and.
The system cannot find the path specified.


So, does anyone know how to use the type command with a specified location?

4
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by mittelgeek
0

Filenames with spaces need quotes TYPE [B]"[/B]C:\Documents and Settings\Owner\My Documents\Log.txt[B]"[/B]

0

I think the problem is that DOS directory and file names cannot be longer than 8 characters. Try this:

TYPE C:\Docume~1\Owner\MyDocu~3\Log.txt

Regards,

mrsjpvan2


Hi everyone! I am making a simple chat program in batch (it doesn't use the net send command). It consist of a main DOS window that you chat with called PM, a .txt file called Log that stores what you say, and a DOS window called PM LOG that prints on the screen what is in the Log.txt file (so you don't have to keep opening it). So, my problem is that whenever I use the TYPE command, I can't specify the location. But if I just say TYPE Log.txt, it will print out Log.txt thats in the folder that PM Log.bat is in. For example PM Log.bat:

some script here..blah blah
TYPE C:\Documents and Settings\Owner\My Documents\Log.txt

then I get this error:

Access is denied.
Error occurred while processing: C:\Documents.
The system cannot find the file specified.
Error occurred while processing: and.
The system cannot find the path specified.


So, does anyone know how to use the type command with a specified location?

0

Sorry - Noticed a typo - use "~1" to replace all characters in the path - like this:

TYPE C:\Docume~1\Owner\MyDocu~1\Log.txt

This will work much better.

mrsjpvan2

I think the problem is that DOS directory and file names cannot be longer than 8 characters. Try this:

TYPE C:\Docume~1\Owner\MyDocu~3\Log.txt

Regards,

mrsjpvan2


Hi everyone! I am making a simple chat program in batch (it doesn't use the net send command). It consist of a main DOS window that you chat with called PM, a .txt file called Log that stores what you say, and a DOS window called PM LOG that prints on the screen what is in the Log.txt file (so you don't have to keep opening it). So, my problem is that whenever I use the TYPE command, I can't specify the location. But if I just say TYPE Log.txt, it will print out Log.txt thats in the folder that PM Log.bat is in. For example PM Log.bat:

some script here..blah blah
TYPE C:\Documents and Settings\Owner\My Documents\Log.txt

then I get this error:

Access is denied.
Error occurred while processing: C:\Documents.
The system cannot find the file specified.
Error occurred while processing: and.
The system cannot find the path specified.


So, does anyone know how to use the type command with a specified location?

0

Yeah you need quotes around file/directories that need quotes.

If you want to find out what the DOS 8.3 filename is use dir /x [i]SOMEDIRNAME[/i] or dir /x [i]SOMEFILENAME[/i] etc...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.