PCbanter

PCbanter (http://www.pcbanter.net/index.php)
-   Windows XP Help and Support (http://www.pcbanter.net/forumdisplay.php?f=15)
-   -   Script to open text file. (http://www.pcbanter.net/showthread.php?t=1111286)

Ivan Denisovich April 12th 21 06:59 PM

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.

John Dulak[_2_] April 12th 21 07:59 PM

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. ''


Ivan Denisovich April 12th 21 09:29 PM

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.

John Dulak[_2_] April 12th 21 10:16 PM

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. ''


JJ[_14_] April 13th 21 10:20 AM

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" %*

Ivan Denisovich April 13th 21 08:44 PM

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.


All times are GMT +1. The time now is 05:42 AM.

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