• Script to open text file.

    From John Dulak@21:1/5 to Ivan Denisovich on Mon Apr 12 17:16:57 2021
    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. ''
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to Ivan Denisovich on Tue Apr 13 16:20:08 2021
    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.

    assoc .bat
    .bat=batfile

    ftype batfile
    batfile="%1" %*
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ivan Denisovich@21:1/5 to All on Tue Apr 13 12:44:52 2021
    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.

    assoc .bat
    .bat=batfile

    ftype batfile
    batfile="%1" %*
    I will try both suggestions. Many thanks to you & john for your help.
    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)