A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Windows XP Help and Support
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Script to open text file.



 
 
Thread Tools Display Modes
  #1  
Old April 12th 21, 06:59 PM posted to microsoft.public.windowsxp.help_and_support
Ivan Denisovich
external usenet poster
 
Posts: 16
Default Script to open text file.

I have always checked a command line on the CMD black screen prior to inserting it into a .bak file, and it has always worked.

Well, I ran into a problem with the script to open a text file, say

"C:\users\myfile.txt"

This works when used on the black screen, but not when placed into a .bak file, which is then executed. The file does not open.

Any thoughts on what the problem is? Thanks for all suggestions.
Ads
  #2  
Old April 12th 21, 07:59 PM posted to microsoft.public.windowsxp.help_and_support
John Dulak[_2_]
external usenet poster
 
Posts: 61
Default Script to open text file.

On 4/12/2021 1:59 PM, Ivan Denisovich wrote:
I have always checked a command line on the CMD black screen prior to inserting it into a .bak file, and it has always worked.

Well, I ran into a problem with the script to open a text file, say

"C:\users\myfile.txt"

This works when used on the black screen, but not when placed into a .bak file, which is then executed. The file does not open.

Any thoughts on what the problem is? Thanks for all suggestions.


Ivan:

I think that should be a file with a ".BAT" extension (as in BATCH) file.

John

--
\\\||///
------------------o000----(o)(o)----000o----------------
----------------------------()--------------------------
'' Madness takes its toll - Please have exact change. ''

  #3  
Old April 12th 21, 09:29 PM posted to microsoft.public.windowsxp.help_and_support
Ivan Denisovich
external usenet poster
 
Posts: 16
Default Script to open text file.

On Monday, April 12, 2021 at 1:59:06 PM UTC-5, John Dulak wrote:
On 4/12/2021 1:59 PM, Ivan Denisovich wrote:
I have always checked a command line on the CMD black screen prior to inserting it into a .bak file, and it has always worked.

Well, I ran into a problem with the script to open a text file, say

"C:\users\myfile.txt"

This works when used on the black screen, but not when placed into a .bak file, which is then executed. The file does not open.

Any thoughts on what the problem is? Thanks for all suggestions.

Ivan:

I think that should be a file with a ".BAT" extension (as in BATCH) file.


With my apologies John, I miswrote. The file is, in fact, ".bat". Any thoughts about the problem I described?

Thanks for posting, and sorry again for my mistake.
  #4  
Old April 12th 21, 10:16 PM posted to microsoft.public.windowsxp.help_and_support
John Dulak[_2_]
external usenet poster
 
Posts: 61
Default Script to open text file.

On 4/12/2021 1:59 PM, Ivan Denisovich wrote:
I have always checked a command line on the CMD black screen prior to inserting it into a .bak file, and it has always worked.

Well, I ran into a problem with the script to open a text file, say

"C:\users\myfile.txt"

This works when used on the black screen, but not when placed into a .bak file, which is then executed. The file does not open.

Any thoughts on what the problem is? Thanks for all suggestions.


Ivan:

If the filename has spaces or odd characters in it it should be enclosed in
quotation marks. Other than that I can't think of anything. IIRC there used to
be a Usenet group devoted to batch files. You might get better answers there.

John

--
\\\||///
------------------o000----(o)(o)----000o----------------
----------------------------()--------------------------
'' Madness takes its toll - Please have exact change. ''

  #5  
Old April 13th 21, 10:20 AM posted to microsoft.public.windowsxp.help_and_support
JJ[_14_]
external usenet poster
 
Posts: 46
Default Script to open text file.

On Mon, 12 Apr 2021 13:29:21 -0700 (PDT), Ivan Denisovich wrote:

With my apologies John, I miswrote. The file is, in fact, ".bat". Any
thoughts about the problem I described?

Thanks for posting, and sorry again for my mistake.


It could probably due to broken file type association. Check with the ASSOC
and FTYPE commands. e.g.

C:\assoc .bat
..bat=batfile

C:\ftype batfile
batfile="%1" %*
  #6  
Old April 13th 21, 08:44 PM posted to microsoft.public.windowsxp.help_and_support
Ivan Denisovich
external usenet poster
 
Posts: 16
Default Script to open text file.

On Tuesday, April 13, 2021 at 4:20:41 AM UTC-5, JJ wrote:
On Mon, 12 Apr 2021 13:29:21 -0700 (PDT), Ivan Denisovich wrote:

With my apologies John, I miswrote. The file is, in fact, ".bat". Any
thoughts about the problem I described?

Thanks for posting, and sorry again for my mistake.

It could probably due to broken file type association. Check with the ASSOC
and FTYPE commands. e.g.

C:\assoc .bat
.bat=batfile

C:\ftype batfile
batfile="%1" %*

I will try both suggestions. Many thanks to you & john for your help.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 06:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.