| | |
Batch File...please help!!
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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?
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?
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 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
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?
•
•
Join Date: Aug 2008
Posts: 4
Reputation:
Solved Threads: 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
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?
![]() |
Similar Threads
- Batch file to send email!! (Windows NT / 2000 / XP)
- Passing result codes to a batch file (Python)
- Logon Script - Batch file assistance required (Windows NT / 2000 / XP)
- Defragmenting XP using Batch File (Windows NT / 2000 / XP)
- Adding URL's To Favourites Using A Batch File (Windows NT / 2000 / XP)
- Batch file that takes arguments (C)
- batch file help - extraction (Windows NT / 2000 / XP)
- Batch file for renaming extensions (Windows NT / 2000 / XP)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Trying to show SQL query results in Excel sheet
- Next Thread: Echo >> problem
| Thread Tools | Search this Thread |






