• Re: what is the fastest command line copy?

    From Newyana2@21:1/5 to Steve Hayes on Mon Mar 31 08:21:49 2025
    XPost: alt.comp.os.windows-11

    On 3/30/2025 10:43 PM, Steve Hayes wrote:

    I want something that works with batch files to automate transfer of
    data files from desktop to laptop & vice versa via USB flash drive


    This may not be what you want, but I keep a VBScript
    on my desktop for copying. I use it for three reasons:

    * Normal Windows copy will stop if it hits a problem.

    * Windows 10 seems to be faulty, typically not copying
    a folder that already exists. I have to delete the old folder
    by hand or the copy/replace doesn't work.

    * Windows doesn't provide an option to only copy over
    newer files.

    So I wrote a script onto which I can drop any folder,
    then enter another folder path, and copy all files that don't
    exist on B from A. It will keep going if a copy fails. I use it
    especially for redundant backup. If you know a bit of scripting
    you could also do things like compare last-modified dates,
    copy over from A even if existing on B, etc.

    The script then writes a list of what was copied, which
    of course is optional.

    Speed? I'd guess that depends on the hardware. VBS and
    FileSystemObject are not fast, but there's very little calculation
    here. The actual script work is minimal. USB is generally quite
    slow writing TO the stick, especially with USB2, so that would
    likely be the bottleneck.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Mon Mar 31 15:47:38 2025
    XPost: alt.comp.os.windows-11

    Newyana2,

    * Windows doesn't provide an option to only copy
    over newer files.

    I don't know if Win10 still has XCopy, but it seems that it can do that :

    /D:m-d-y Copies files changed on or after the specified date.
    If no date is given, copies only those files whose
    source time is newer than the destination time.

    * Windows 10 seems to be faulty, typically not copying a folder that
    already exists. I have to delete the old folder by hand or the
    copy/replace doesn't work.

    an ownership problem ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Mon Mar 31 10:54:31 2025
    XPost: alt.comp.os.windows-11

    On 3/31/2025 9:47 AM, R.Wieser wrote:
    Newyana2,

    * Windows doesn't provide an option to only copy
    over newer files.

    I don't know if Win10 still has XCopy, but it seems that it can do that :

    /D:m-d-y Copies files changed on or after the specified date.
    If no date is given, copies only those files whose
    source time is newer than the destination time.

    That's not quite what I want. I usually want to just copy
    files that don't already exist in the redundant backup. That
    was part of the reason for the script: So that I can send 18
    missing photos to the redundant photo folder without also
    copying over the other 1,200.

    For me, personally, life is too short for command line. I write
    scripts so that next time I do the same thing it will be effortless.
    But I know that some people prefer commandline. I was just putting
    it out there. Script is vastly more flexible and easier once the
    script is written. But not everyone wants to learn scripting.

    * Windows 10 seems to be faulty, typically not copying a folder that
    already exists. I have to delete the old folder by hand or the
    copy/replace doesn't work.

    an ownership problem ?


    No. I don't know what it is. I'm running as admin with UAC
    and LUA disabled. These are files copied to data partitions.
    In fact, my main data partitions are formatted FAT32 to avoid
    such complications. But I've found repeatedly, when dropping
    a folder into a data partition that already has that folder, I get
    no popup asking whether I want to overwrite. Then I check the
    existing folder and the new files are not there. So I now delete
    the existing folder first, then drop the new folder onto the window.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Burns@21:1/5 to All on Mon Mar 31 15:59:49 2025
    XPost: alt.comp.os.windows-11

    Newyana2 wrote:

    R.Wieser wrote:

    I don't know if Win10 still has XCopy, but it seems that it can do that :

       /D:m-d-y     Copies files changed on or after the specified date. >>                 If no date is given, copies only those files whose
                    source time is newer than the destination time.

       That's not quite what I want. I usually want to just copy
    files that don't already exist in the redundant backup. That
    was part of the reason for the script: So that I can send 18
    missing photos to the redundant photo folder without also
    copying over the other 1,200.
    That's why someone suggested robocopy, it can do that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From knuttle@21:1/5 to R.Wieser on Mon Mar 31 10:59:23 2025
    XPost: alt.comp.os.windows-11

    On 03/31/2025 9:47 AM, R.Wieser wrote:
    Newyana2,

    * Windows doesn't provide an option to only copy
    over newer files.

    I don't know if Win10 still has XCopy, but it seems that it can do that :

    /D:m-d-y Copies files changed on or after the specified date.
    If no date is given, copies only those files whose
    source time is newer than the destination time.

    * Windows 10 seems to be faulty, typically not copying a folder that
    already exists. I have to delete the old folder by hand or the
    copy/replace doesn't work.

    an ownership problem ?

    Regards,
    Rudy Wieser


    I use third party software SyncBackFree: https://www.2brightsparks.com/downloads.html

    It is free for use, and gives you a lot of options to back up you computer.

    I have used the free version for over a decade to sync my laptop and
    desktop. I have also the backup funtion and mirror function on other computers.

    It is easy to set up what you want done with specific files and folders.
    It is easy to run to do what you have set up in the program.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Mon Mar 31 17:26:04 2025
    XPost: alt.comp.os.windows-11

    Knuttle,

    I use third party software SyncBackFree:

    Don't tell me. I wrote my own file-backup program. :-) (Why ? Because I wanted to know if I could)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Mon Mar 31 17:32:49 2025
    XPost: alt.comp.os.windows-11

    Newyana2,

    That's not quite what I want. I usually want to just copy
    files that don't already exist in the redundant backup.

    Ah yes, I misunderstood what you wanted.

    So that I can send 18 missing photos to the redundant photo
    folder without also copying over the other 1,200.

    That means that if you change a file (photo) on the source the target will
    keep holding the old one ... Not really what I expect from a backup. :-|

    But you could than still use xcopy. As long as the files on the source are same/older than on the target it won't try to copy them.

    For me, personally, life is too short for command line. I write scripts
    so that next time I do the same thing it will be effortless.

    I have no problem with repeatedly typing a command. But yes, when I have to
    do multiple things in the same order I use Batch. But when string
    manipulation or something complex is called for I use vbscript (OS=XP)
    myself (with a file-extension causings cscript to be used).

    an ownership problem ?

    No. I don't know what it is.
    ...
    when dropping a folder into a data partition that already has that folder,
    I get no popup asking whether I want to overwrite.

    Yeah, thats odd.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Mon Mar 31 13:05:11 2025
    XPost: alt.comp.os.windows-11

    On 3/31/2025 11:26 AM, R.Wieser wrote:
    Knuttle,

    I use third party software SyncBackFree:

    Don't tell me. I wrote my own file-backup program. :-) (Why ? Because I wanted to know if I could)


    I've never really done much of this. You're backing up daily?
    I just keep redundant copies on matching disks, store all important
    things on a 3 GB partition, then periodically write desktop, appdata
    and that partition's content to a DVD. So much is longterm data.
    Photos, tech info, reference materials, videos -- none of that
    changes, so I just put it on USB sticks once in a while. Along with
    disk images, I periodically put copies of all that in a safe deposit
    box.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Mon Mar 31 14:43:40 2025
    XPost: alt.comp.os.windows-11

    On 3/31/2025 2:18 PM, R.Wieser wrote:
    Newyana2,

    I've never really done much of this. You're backing up daily?

    No, its a monthly thing on that an USB drive. Though I've got an USB stick on which I backup my "high change" (source) files a bit more frequently (using vbscript, checking for newer files :-) ).

    So much is longterm data. Photos, tech info, reference materials,

    For me its mostly the latter two. Hence the monthly.

    Along with disk images, I periodically put copies of all that in a safe
    deposit box.

    Following the "a backup on the same 'puter isn't a backup. A backup stored in the same building isn't a backup either" saying I see. :-)


    Covering different bases. If I lose it tomorrow, am I prepared?
    Pretty much. Though total loss would be a big hassle. Like you I
    back up frequently to a stick if I'm working on something. But I'm
    very organized, so I don't really check by dates. I deal with
    locations.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Steve Hayes on Mon Mar 31 13:40:19 2025
    XPost: alt.comp.os.windows-11

    On Mon, 31 Mar 2025 04:43:39 +0200, Steve Hayes wrote:
    On Mon, 31 Mar 2025 02:12:05 +0100, Dual Boot Windows <invalid@invalid.invalid> wrote:

    [quoted text muted]
    users prefer GUI version.

    <https://fastcopy.jp/>


    Does xcopy/xxcopy still work?

    I want something that works with batch files to automate transfer of
    data files from desktop to laptop & vice versa via USB flash drive.

    That's what I use Robocopy for, several times a day, in a batch file
    I call ... usb. (Well, usb.btm, if you want to get technical, since
    I'm using TCCLE as my shell.)

    Xcooy is part of the OS, as you could have found by typing
    xcopy /?
    on the command line. I've never used it myself.

    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Mon Mar 31 20:18:42 2025
    XPost: alt.comp.os.windows-11

    Newyana2,

    I've never really done much of this. You're backing up daily?

    No, its a monthly thing on that an USB drive. Though I've got an USB stick
    on which I backup my "high change" (source) files a bit more frequently
    (using vbscript, checking for newer files :-) ).

    So much is longterm data. Photos, tech info, reference materials,

    For me its mostly the latter two. Hence the monthly.

    Along with disk images, I periodically put copies of all that in a safe deposit box.

    Following the "a backup on the same 'puter isn't a backup. A backup stored
    in the same building isn't a backup either" saying I see. :-)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Tue Apr 1 09:11:14 2025
    XPost: alt.comp.os.windows-11

    Steve,

    I've hitherto uased batch files, which are a form of scripting.

    Batch files work well enough for most "stack a number of commands" stuff.

    It however is a pain in the behind when whating to do any kind of string (filename) handling (due to having several escape characters and its
    continuous re-parsing of arguments)

    Is there a better tool to use for this?

    That fully depends on what your goal is. As said, using it to execute a (number of) program(s) with fixed or commandline arguments (%1 ... %9) it
    will mostly work.

    Not so much if you need to do something with those commandline arguments.
    IOW, in that case /almost anything/ (with a concept of variables) will work better.

    Perhaps PowerShell has string-handling too (never used it) ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Tue Apr 1 07:00:02 2025
    XPost: alt.comp.os.windows-11

    On Mon, 31 Mar 2025 10:54:31 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 3/31/2025 9:47 AM, R.Wieser wrote:
    Newyana2,

    * Windows doesn't provide an option to only copy
    over newer files.

    I don't know if Win10 still has XCopy, but it seems that it can do that :

    /D:m-d-y Copies files changed on or after the specified date.
    If no date is given, copies only those files whose
    source time is newer than the destination time.

    That's not quite what I want. I usually want to just copy
    files that don't already exist in the redundant backup. That
    was part of the reason for the script: So that I can send 18
    missing photos to the redundant photo folder without also
    copying over the other 1,200.

    For me, personally, life is too short for command line. I write
    scripts so that next time I do the same thing it will be effortless.
    But I know that some people prefer commandline. I was just putting
    it out there. Script is vastly more flexible and easier once the
    script is written. But not everyone wants to learn scripting.

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?


    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Steve Hayes on Tue Apr 1 03:44:59 2025
    XPost: alt.comp.os.windows-11

    On Tue, 4/1/2025 1:00 AM, Steve Hayes wrote:
    On Mon, 31 Mar 2025 10:54:31 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 3/31/2025 9:47 AM, R.Wieser wrote:
    Newyana2,

    * Windows doesn't provide an option to only copy
    over newer files.

    I don't know if Win10 still has XCopy, but it seems that it can do that : >>>
    /D:m-d-y Copies files changed on or after the specified date.
    If no date is given, copies only those files whose
    source time is newer than the destination time.

    That's not quite what I want. I usually want to just copy
    files that don't already exist in the redundant backup. That
    was part of the reason for the script: So that I can send 18
    missing photos to the redundant photo folder without also
    copying over the other 1,200.

    For me, personally, life is too short for command line. I write
    scripts so that next time I do the same thing it will be effortless.
    But I know that some people prefer commandline. I was just putting
    it out there. Script is vastly more flexible and easier once the
    script is written. But not everyone wants to learn scripting.

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?

    At first I considered writing an answer, but a list is a good
    place to start a discussion. This list isn't even complete, unfortunately.
    That means, for the people who wrote this answer, they had exactly
    the same problem -- not enough collective expertise to write a good
    answer.

    https://en.wikipedia.org/wiki/Scripting_language

    At work, any time you collaborate, the first problem is
    finding a common language that everyone understands. For example,
    as a joke, two of us selected Fortran, even though we knew it sucked
    for the job, but like good engineers, you use whatever you've got
    to make stuff. We couldn't just go on a lark and take a language
    course for a week, and do the project.

    They don't distinguish between things that are available
    as an interactive shell, or run from a file as a "script".
    Some of the items in that list, are scripting languages,
    others are interactive shells that also script.

    cmd.exe < hereis.bat # Feeding a script of sorts, to a shell instance, referred
    # to in some environments, as a "hereis" approach.

    Some shells for example, fork subshells when running individual
    operating system commands.

    Some of the items in a shell are "built-in" functions.
    There is no "dir.exe" for example, which means "dir"
    must be a built-in. Some shells will actually tell
    you an item is a built-in. The first item here is a built-in,
    the second item is an executable at OS level.

    where dir
    INFO: Could not find files for the given pattern(s).

    where cmd
    C:\Windows\System32\cmd.exe

    where copy
    INFO: Could not find files for the given pattern(s).

    where move
    INFO: Could not find files for the given pattern(s).

    where net
    C:\Windows\System32\net.exe

    There are enough scripting languages, that if we in the newsgroup
    sat down at a table, we might have nothing in common. One
    person may be a Perl expert. Another does nothing but batchscript.
    I own two Perl books... and have written three lines of Perl code :-)
    At my work, *all* the hardware engineers wrote Perl scripts.
    I was the exception (because my design was pretty simple and
    didn't need it, all I did was a processor board). I've done
    complex designs (300 ICs) without crutches :-) I did it all
    the "hard way".

    I happen to like AWK. It can make system calls, as well as
    do text processing. But that's an acquired taste, like a
    lot of scripting languages. It has some severe weaknesses.
    It can take two hours to figure out how to sort something.
    and the only way to stat() a file, is via an add-on, which
    is why I'm not allowed to post any AWK scripts that need
    stat(). Because then I would have to explain arcane recipes
    for how you run the damn thing.

    Bot others here will be adamant batchscript people, and
    I don't intend on getting into any language wars.
    If you're wondering why "someone just doesn't tell you what to use",
    it's because some of have been through language wars, and
    we know better, about how to behave. But that also makes it
    harder for you to get started.

    My folks at work, were very professional about it, even though
    it wasn't their specialty. My first question, they answered it.
    When I came back, they said "go down to the Computer Book Store
    and buy a book, after you've read it, ask us your question again".
    Which was the perfect advice. The idea is, after that,
    you will only be asking "interesting" questions, and not
    fundamental questions. I wouldn't answer the same way here,
    but that's how you do it at work.

    To get really good at scripting, you need a book. While
    people here could write you a script, that isn't the best
    educational material. But as an example, when I wanted to
    learn Bourne Shell, we got some commercial software from
    some company. It had a Bourne Shell installer file. Must
    have been three thousand lines of code. It had just about
    every Bourne trick known to man in it :-) I hugged that puppy,
    because if I needed inspiration writing a Bourne shell
    script, I would open that file and scroll through it,
    looking for a "programming pattern" that explains the
    best way to do it. That thing was better than a book,
    because it had real patterns in it. But you're not
    gifted a thing like that, too often.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Paul on Mon Mar 31 12:10:27 2025
    XPost: alt.comp.os.windows-11

    On Mon, 31 Mar 2025 00:47:15 -0400, Paul wrote:
    It's also a *dangerous* program. If you mirror (/mir) an empty folder to
    a full folder, the full folder can be erased.


    Hence the advice to run it once with the /L option when using any
    combination of options that you're not 100% confident about.

    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to Dual Boot Windows on Tue Apr 1 02:01:25 2025
    XPost: alt.comp.os.windows-11

    On 3/30/25 6:12 PM, Dual Boot Windows wrote:
    On 30/03/2025 00:03, T wrote:
    Hi All,

    It use to be robo copy for a mass copy of a
    directory.  Does that still exist?  Or is
    there something better?

    Many thanks,
    -T



    You can use FastCopy GUI program. It has a cmd line built in but Windows users prefer GUI version.

    <https://fastcopy.jp/>


    I bought a perpetual license.

    I took me a bit to figure out the command line,
    but afterwards, it works awesome.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Steve Hayes on Tue Apr 1 09:26:02 2025
    XPost: alt.comp.os.windows-11

    On 4/1/2025 1:00 AM, Steve Hayes wrote:

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?


    Big topic. I guess a lot of it depends on what you're used to.
    For people who started with DOS, commandline feels natural.
    And it can do some complex things. I try to avoid it because
    it's relatively limited and combines coding with doing, by which
    I mean, every time I want to do something I have to remember
    or look up the exact syntax I'll need. So I have to write the code
    every time, so to speak. The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    With VBScript I spend some time writing the script, but from
    then on it's usually just a drag/drop operation to do repetitive
    jobs. But if you know DOS and commands for various executables,
    and you don't want to have to take on a whole new topic of coding,
    then of course, scripting is not so conveninent.

    When Microsoft invented the Windows Script Host and made
    VBS/JS COM-compatible, the idea was basically to update DOS to
    the GUI world. It's interpreted (script) but can do most things
    that compiled software can do. As an HTA (script-powered IE
    windows) it can also have a UI, buttons, etc. I've written such
    tools as graphic editors, MSI installer unpackers, scanner interface, javascript de-obfuscator, email storage database, thumbnail
    viewer, base64 decoder/encoder, MP4 metadata editor, PE file
    icon extractor (by parsing the resource table), and a parser for
    my website server logs that replaces IP with hotsname and
    location...

    Lately I have a script to dig
    articles out of NYTimes webpages. The NYTimes shows 3 paragraphs
    and then says, "Oh, woops. We can't seem to find the rest of
    the article." They've gone to great lengths to embed it in
    javascript/json so that they can force javascript in order to spy
    on visitors.

    I also have simple scripts to do things like fix Unix
    line returns in text files, write a log of sorted folder sizes for a
    given location, getting subfolder through a recursive operation,
    or put the text of a dropped file onto the Clipboard.

    Using COM means that there are a vast number of "programlets"
    that script can call into. It can automate IE. And Microsoft designs
    most components to be scriptable. WMI for system info. WIA
    for graphics. FileSystemObject for file/folder operations and Registry
    access. Basically, VBS is easier but slower than compiled software.

    Many "COM objects" were developed in concert with a Win32 API.
    A COM object is essentially the same idea as an ActiveX control.
    In fact, I once had a COM book written by a very cranky professor
    who spent a whole page proving that "ActiveX" has no actual
    meaning aside from marketing. Though in practice, ActiveX basically
    means "COM objects that script can use because they have a
    Dispatch or late-bound interface".


    Things like
    Windows Installer, Windows Image Acquisition, Windows Management,
    and so on can be used in software or by script. Programmers can also
    write their own COM objects. Typically there are
    3 layers of access: Direct Win32 API, direct COM -- calling into the
    library using datatypes -- and scripting, which must be interpreted.
    For instance, the Windows Installer API allows me to unpack and
    document an MSI installer file via script or in compiled software
    via direct C++-style functions. There's a complete API for both
    approaches. And there's a typed COM API for compiled software
    that's slower than direct DLL functions but faster than the scripting
    objects.

    Lately I've been working on a program to download map images
    and alter hue/saturation/lightness while also resizing the image.
    For such a work intensive operation, GDI+ turns out to be best, but
    I also tested using the WIA wrapper library via direct COM. I could
    actually do this with script, but it would be even slower because I have
    access the file bytes through several steps rather than as memory
    addresses of bytes.

    I think of it kind of like a restaurant. The cook is writing compiled software. He can cook whatever you need. The waiter asks for
    things through the order window. Both CL and WSH are waiters,
    but the former has a limited menu that must be memorized, while
    the latter can order nearly anything that the cook has the capacity
    to make. So they serve two different purposes in many ways.

    The real power is in being the cook, but that's not always feasible,
    and it's sometimes not worth the work. In fact, these days, many cooks
    are just glorified waiters, wrapping a number of libraries in a few codes
    of .Net code. That's true not only on Windows. Things like Qt are the workhorses for a lot of bloated multi-wrapper software that manages
    to be "cross-platform" by not actually writing to any platform. The dream
    of Java is now sort of possible because modern harware can handle
    the massive bloat and inefficiency of such things. (Remember Longhorn?
    That was going to be Microsoft's .Net-based OS. After 3 years they had
    to give it up because, by their own description, no hardware existed that
    could handle the excessive bloat of buildiing a whole OS on top of an interpreted sandbox wrapper. If it had worked then we might have had
    cloud and "tablet PCs" earlier.)

    There's a BAT script available for downloading any desired Win10/11
    ISO and writing it to USB stick or to ISO file. It's very clever, even
    showing GUI menus. I haven't figured out how it does that, but it's a
    nice job. In general, though, BAT, and CL generally, is limited to
    one-liners. It's great if you need a DISM call and only PS can do it,
    but that kind of thing is mainly intended for sysadmins doing automated
    system setups. (PS was specifically designed to lure Linux sysadmins
    who are used to calling applets via console. That's why you have to
    call dozens of different little specialized applets rather than just
    calling into it like: PS DoThis, PS DoThat, as it was with DOS.)

    In this particular case, copying files, I can customize scripts to do
    any kind of file operation automatically. So it's especially useful for something like my CopyNewToFolder script. Once written I only have
    to drop a folder onto the script, type in the destination, and it's done.
    Later I could adjust that if needed to only copy JPGs, only copy newer
    modified dates, etc.

    It's not for everyone because script has a learning curve, obviously.
    The COM objects also require acclimation, just as the CL objects
    like robocopy or xcopy or DISM require that one know how to call
    into them each time they're used.

    I was offering because I can simply paste the script here. Script,
    though, is more wordy than CL, and may be harder to troubleshoot
    if you're not familiar with the coding. Much of the bloat is the error
    trapping and convenience. The code to copy over files is compact,
    but in order to make it drag-drop requires GUI message boxes and
    input boxes.

    In the bigger picture, MS are threatening to remove Windows Script
    Host in 2027. In typical MS style they've said, "This is not our official
    way of doing things anymore, which we call "deprecated", but we
    understand that corporate IT people will have our heads if we break it,
    so... maybe just try to get used to the idea that it won't exist forever."

    MS want to rent software and put ads in it. The whole trend of
    rental software requires two big transitions. One is that customers
    must be acclimated to intrusion and the ruse that their software is
    running "in the cloud". The other is to convince people that rental
    software is better than installed software. Both claims are absurd,
    especially now that most necessary software is now available as
    OSS for free. So how do MS do it? By making it increasingly difficult
    to actually use your own computer directly. WSH was for the handyman.
    MS don't want no stinking handymen messing with their plans. So it
    likely won't be long before programming options are restricted,
    scripting is gone, software not from the MS store is banned "for
    security reasons", and all that remains is cloudy rentals along with
    PS for IT people who need to manage installing and maintaining the
    actual OS. The rest will probably be something like packages. Companies
    will rent "the office package" for, say, 1,500 workstations. But in the meantime, before we're all forced to Linux, script allows people to
    write much of their own software in a relatively simple way. But
    don't worry, we'll probably get the "email, shopping and entertainment" package. :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Wed Apr 2 08:50:34 2025
    XPost: alt.comp.os.windows-11

    On Tue, 1 Apr 2025 09:26:02 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 4/1/2025 1:00 AM, Steve Hayes wrote:

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?


    Big topic. I guess a lot of it depends on what you're used to.
    For people who started with DOS, commandline feels natural.
    And it can do some complex things. I try to avoid it because
    it's relatively limited and combines coding with doing, by which
    I mean, every time I want to do something I have to remember
    or look up the exact syntax I'll need. So I have to write the code
    every time, so to speak. The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.


    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Steve Hayes on Wed Apr 2 04:15:57 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 2:50 AM, Steve Hayes wrote:
    On Tue, 1 Apr 2025 09:26:02 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 4/1/2025 1:00 AM, Steve Hayes wrote:

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?


    Big topic. I guess a lot of it depends on what you're used to.
    For people who started with DOS, commandline feels natural.
    And it can do some complex things. I try to avoid it because
    it's relatively limited and combines coding with doing, by which
    I mean, every time I want to do something I have to remember
    or look up the exact syntax I'll need. So I have to write the code
    every time, so to speak. The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.



    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Here, my personal copy program returns a value of "1", if the source file cannot be opened. This clause was written by an AI by the way.
    "It doesn't have to make sense", as the AI would tell you :-)
    What the AI didn't tell me, is there is a bug in one of the
    library routines I should know about.

    # part of paulcopy64.exe source code... Mostly written by an AI.
    # I only fix them up and make them work. The comment is written by the AI.

    // Open the source file in binary mode
    FILE *source = fopen64(argv[1], "rb");
    if (!source) {
    perror("Error opening source file");
    return 1;
    }

    Now, we test in a Command Prompt, and see if the returned integer
    error code, is arriving OK or not. It is. If each error has a
    different integer number, you can tell the error types apart,
    with numeric checks of %errorlevel% .

    paulcopy64 a b
    Error opening source file: No such file or directory

    echo %errorlevel%
    1 # Om my! My copy did not proceed.

    Making a batch file is not "just making a laundry list".
    It needs conditional checks (somehow) of each
    stage of the operation. And in my C program snippet, you can see
    the AI is doing the same thing. The AI assumes I will be scripting
    calls to "paulcopy64.exe" and scripting needs the number, to check
    the program run went OK.

    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they are lost,
    by the next utility program loading its success or failure status
    into that single variable in the shell.

    Look at the following and note my handling mistake. The error result
    from the "dir" command, has overwritten the "1" left in the %errorlevel% . There was no error in the "dir" run and the result from it is "0".

    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    The paulcopy64.exe was actually compiled on Ubuntu 23.04
    as a cross compile, as I have not managed to get a good
    mingw64 for Windows set up here. So I just cross-compiled
    it, and that is why the program is 252,122 bytes, when it
    should be a lot smaller for a dumb copy program.

    # Asking Ubuntu to make a 64-bit version of a Windows EXE (a PE32+ EXE file).
    # The FILE_OFFSET_BITS is to enable 64 bit long length fields and stuff.
    # The compiler package (effectively a script) must be installed for the executable
    # of the compiler, to be found. "x86_64-w64-mingw32-gcc" does not exist by default.
    # This allows my program to have "gobs" of RAM, compiling it this way :-)

    /usr/bin/x86_64-w64-mingw32-gcc -D_FILE_OFFSET_BITS=64 -I/usr/x86_64-w64-mingw32/include -o paulcopy64.exe paulcopy64.c

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 10:35:41 2025
    XPost: alt.comp.os.windows-11

    Paul,

    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they
    are lost,
    ...
    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    On the other hand, you should not contuinue (after the failed copy) when you are getting an error ...

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to R.Wieser on Wed Apr 2 05:54:39 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 4:35 AM, R.Wieser wrote:
    Paul,

    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they
    are lost,
    ...
    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    On the other hand, you should not contuinue (after the failed copy) when you are getting an error ...

    Regards,
    Rudy Wieser



    That return() is on main().

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Steve Hayes on Wed Apr 2 07:53:25 2025
    XPost: alt.comp.os.windows-11

    On 4/2/2025 2:50 AM, Steve Hayes wrote:
    The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.


    Yes. That's one way of operating. As you said, that's
    technically a way of scripting, inasmuch as it's interpreted
    text. I was comparing scripting in the sense of WSH to
    typing commands in a console window. As I said at the start,
    life is too short for commandline. There's a fetish aspect to
    typing into console windows that oldtimers like and young
    people regard as a hazing process. It's much worse on Linux.
    And it's not unusual that I get stuck using that method.
    Every time I want to update my Raspberry Pi I have to find
    that little piece of paper I saved that records the requisite
    incantations. That's simply a case of programmers not finishing
    the job. After 30 years of GUI we shouldn't ever HAVE TO open
    a console window.

    Much of the reason we do is not even programmer
    laziness. It's more oldtimer stubbornness. Awhile back I was
    trying out Xubuntu and couldn't adjust the clock. Odd. I finally
    found a discussion online where the man who coded the clock said
    that he specifically didn't add GUI settings because he finds
    console window easier. But it's a GUI system! He's like a kid in
    a self-driving car who likes to have a clutch pedal just so that he
    can feel like he's a cowboy. And he wants everyone to know
    that he's a cowboy, who's so tough that he's even played video
    games of wrestling a grizzly bear. So he's not going to let anyone
    else adjust the clock via GUI, either.

    I have a file that I keep on hand to remind me of various DISM
    commands I need. Could I put those in a PS script? Maybe. But I
    usually just need one. In fact I have a VBS script to clean TEMP
    files, then I pop up a messagebox at the end that says,
    "Also clean up winsxs with this command:
    Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase"

    That way I don't have to go looking up the command. I can just copy
    and paste from the messagebox window. But why
    isn't there a "Cleanup winsxs" button in System -> Advanced Options
    Advanced -> Advanced -> Advanced -> Advanced?

    If you're only using pre-written BAT files then that's different.
    So, then, what's the difference between that and WSH?

    The difference would be that
    BAT files are a primitive approach that WSH was designed
    to replace... 30 years ago. Very limited GUI options. Very limited
    options for multiple contexts and concurrent operations. No
    classes, subroutines, etc. No way to exploit the vast COM
    libraries on Windows. Mostly just one-liner calls to
    external applets that can do something for you. Your 4 BAT
    files only provide options for 4 exact copy operations from A
    to B, B to A, A to C, C to A. In other words, it's a 30-year-old
    paradigm intended for console screens. My drag-drop script
    defines the files to move through simple drag-drop. The options
    are unlimited. GUI. Post-1995.

    DOS/BAT is basically one-liner calls that ignore
    the vast programming options that Microsoft developed since
    1995. It's designed to mimic the DOS command screen that
    oldtimers know from pre-GUI days.

    DOS/BAT, and now PS, work well for people who started
    with DOS and don't need anything else. As I said, scripting
    is not for everyone. I was just just pointing out, for anyone
    who's curious, that there are options to use more customized
    approaches that are not just complicated incantation one-liners
    strung together.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Wed Apr 2 07:57:45 2025
    XPost: alt.comp.os.windows-11

    On 4/2/2025 4:35 AM, R.Wieser wrote:

    On the other hand, you should not contuinue (after the failed copy) when you are getting an error ...


    >> /usr/bin/x86_64-w64-mingw32-gcc -D_FILE_OFFSET_BITS=64 -I/usr/x86_64-w64-mingw32/include -o paulcopy64.exe paulcopy64.c

    Anyone who can cook up a command line like that...
    You don't ask questions. :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to Paul on Wed Apr 2 12:41:35 2025
    XPost: alt.comp.os.windows-11

    Paul <nospam@needed.invalid> wrote:
    On Wed, 4/2/2025 2:50 AM, Steve Hayes wrote:
    On Tue, 1 Apr 2025 09:26:02 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 4/1/2025 1:00 AM, Steve Hayes wrote:

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?

    Big topic. I guess a lot of it depends on what you're used to.
    For people who started with DOS, commandline feels natural.
    And it can do some complex things. I try to avoid it because
    it's relatively limited and combines coding with doing, by which
    I mean, every time I want to do something I have to remember
    or look up the exact syntax I'll need. So I have to write the code
    every time, so to speak. The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Note that (this part of) the discussion is for .bat files which mainly contain a single 'complicated' command, so the user does not have to
    remember the complicated command, but just the name of hir .bat file.

    For *such* a .bat file, if the command fails, it will give the same
    error(s) as if the command was typed manually, so there's no need for
    checking the error number.

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Yes, scripting - i.e. also .bat files - is "programming", but for
    simple .bat files, such are under discussion here, there's no need to
    make things more complicated than just putting the 'complicated' command
    in a .bat file.

    [...]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 16:15:43 2025
    XPost: alt.comp.os.windows-11

    Paul,

    That return() is on main().

    Yes, and ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 16:19:21 2025
    XPost: alt.comp.os.windows-11

    Newyana2,


    /usr/bin/x86_64-w64-mingw32-gcc -D_FILE_OFFSET_BITS=64 -I/usr/x86_64-w64-mingw32/include
    -o paulcopy64.exe paulcopy64.c

    Anyone who can cook up a command line like that...
    You don't ask questions. :)

    You mean something like :

    %BD%\tasm32b /d?BaseName=%1 /d??Resource="%RD%" /t /kh10000 /l /m2
    /i%HD%\Inc /i%HD%\Dll /i%HD%\DBG %1

    Been there, done that - and put it into a batchfile. :-)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 16:26:50 2025
    XPost: alt.comp.os.windows-11

    Newyana2,

    As I said at the start, life is too short for commandline.

    How do you keep tabs on the progress of your scripts ?

    Personally I like seeing a long-running script telling me what its currently doing. And the easiest way is to run the (VB)Script in a console so that
    you can see what its outputting - without having to press the "OK" button on everything it outputs.

    Though that doesn't mean you can't start them by double-clicking or dropping files/folders onto them.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Wed Apr 2 11:03:05 2025
    XPost: alt.comp.os.windows-11

    On 4/2/2025 10:26 AM, R.Wieser wrote:
    Newyana2,

    As I said at the start, life is too short for commandline.

    How do you keep tabs on the progress of your scripts ?

    Personally I like seeing a long-running script telling me what its currently doing. And the easiest way is to run the (VB)Script in a console so that
    you can see what its outputting - without having to press the "OK" button on everything it outputs.

    Though that doesn't mean you can't start them by double-clicking or dropping files/folders onto them.

    I've never used the console output. Generally I just
    use error trapping and show a msgbox at the end: "Done."
    For instance, if a script expects a dropped file then if there
    is no drop then I'll show an inputbox or a message.

    For scripts that I'm going to use more than once I try
    to make them robust in that way. I check whether files
    exist, I confirm math operations... then at the end I add
    On Error Resume Next. So I don't really need to monitor
    anything. That's done when writing the script. Much of the
    point is to be able to just double-click or drop and have
    the details taken care of. It shouldn't need console output.

    For more complicated things I'll do as Paul described, using
    numbered errors. But that's mostly in compiled software,
    where I'm using 3rd-party libraries that might return errors,
    which I might want to be able to troubleshoot. But even then,
    there shouldn't be errors or weaknesses in my own code. If
    I put up an inputbox for a file path, that path should exist.
    If I put up an inputbox for a number, that should pass
    IsNumeric.

    If I want a report then I put that in the script. for instance,
    my file copy script generates a text file listing what was
    copied.

    What kinds of things do you do that need console reporting
    mid-script?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to R.Wieser on Wed Apr 2 11:04:26 2025
    XPost: alt.comp.os.windows-11

    On 4/2/2025 10:19 AM, R.Wieser wrote:

    %BD%\tasm32b /d?BaseName=%1 /d??Resource="%RD%" /t /kh10000 /l /m2
    /i%HD%\Inc /i%HD%\Dll /i%HD%\DBG %1


    Oh, boy. It looks like I'll have to call in some Perl nuts for backup.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to R.Wieser on Wed Apr 2 11:40:19 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 10:15 AM, R.Wieser wrote:
    Paul,

    That return() is on main().

    Yes, and ?

    Regards,
    Rudy Wieser



    It's the same as exit().

    Execution does not continue past that point.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Wed Apr 2 12:04:36 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 11:04 AM, Newyana2 wrote:
    On 4/2/2025 10:19 AM, R.Wieser wrote:

    %BD%\tasm32b /d?BaseName=%1 /d??Resource="%RD%" /t /kh10000 /l /m2
    /i%HD%\Inc /i%HD%\Dll /i%HD%\DBG %1


    Oh, boy. It looks like I'll have to call in some Perl nuts for backup.


    With the command I cooked up, there are only so many options, and
    it is the process of deduction. I think only about eight possibilities,
    and some don't count and so on :-)

    I think you would find my set of lines to compile directly with
    the Visual Studio compiler without opening Visual Studio at all,
    more interesting. That one took all morning to cook up. The Linux
    one is more thinking than typing, the VS one is more typing
    than thinking. You have to install SDKs in a modern Visual Studio
    Community Edition, to even work with C/C++ source, and the SDKs
    have to be included in some of the path(s).

    The scary part, is tools like gcc or g++, have an infinite number
    of parameters, and there are people who actually understand
    all of it. That's well past my pay scale.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 18:04:03 2025
    XPost: alt.comp.os.windows-11

    Newyana2,

    Generally I just use error trapping and show a msgbox at the end: "Done."

    The "error trapping" goes without saying.

    As for the latter ? I've got short-running scripts I do not even bother to
    let them tell they are finished.

    But when its a longer-running script (or one making a lot of changes) than I have the need to see it progressing. Yes, my earlier long-running scripts finished like yours, with a msgbox.

    But have you never noticed that time slows to a crawl when you are waiting
    for something to happen but have no idea how long it will take ? I rather
    see paint dry.

    The easiest "progres indicator" is to output to a console window.

    If I want a report then I put that in the script. for instance,
    my file copy script generates a text file listing what was
    copied.

    Same here. What was updated, was new, or could not be copied for whatever reason.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 18:06:09 2025
    XPost: alt.comp.os.windows-11

    Newyana2

    %BD%\tasm32b /d?BaseName=%1 /d??Resource="%RD%" /t /kh10000 /l /m2
    /i%HD%\Inc /i%HD%\Dll /i%HD%\DBG %1


    Oh, boy. It looks like I'll have to call in some Perl nuts for backup.

    Don't make me post the whole batchfile ! :-)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 18:13:49 2025
    XPost: alt.comp.os.windows-11

    Paul,

    That return() is on main().

    Yes, and ?

    It's the same as exit().

    Execution does not continue past that point.

    Your example doesn't show a "return()" of any kind. Nor a "main()" for that matter...

    Bad examples are bad. :-(

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Frank Slootweg on Wed Apr 2 12:15:46 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 8:41 AM, Frank Slootweg wrote:
    Paul <nospam@needed.invalid> wrote:
    On Wed, 4/2/2025 2:50 AM, Steve Hayes wrote:
    On Tue, 1 Apr 2025 09:26:02 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 4/1/2025 1:00 AM, Steve Hayes wrote:

    I've hitherto uased batch files, which are a form of scripting.

    Is there a better tool to use for this?

    Big topic. I guess a lot of it depends on what you're used to.
    For people who started with DOS, commandline feels natural.
    And it can do some complex things. I try to avoid it because
    it's relatively limited and combines coding with doing, by which
    I mean, every time I want to do something I have to remember
    or look up the exact syntax I'll need. So I have to write the code
    every time, so to speak. The whole point of scripting for me is
    so that I only have to do something once. Next time I only have
    to double-click or drag-drop.

    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Note that (this part of) the discussion is for .bat files which mainly contain a single 'complicated' command, so the user does not have to
    remember the complicated command, but just the name of hir .bat file.

    For *such* a .bat file, if the command fails, it will give the same error(s) as if the command was typed manually, so there's no need for checking the error number.

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Yes, scripting - i.e. also .bat files - is "programming", but for
    simple .bat files, such are under discussion here, there's no need to
    make things more complicated than just putting the 'complicated' command
    in a .bat file.

    [...]


    Well, someone is expressing an interest in scripting, and I don't
    want them picking up any bad habits.

    I use a different approach than Steve, for one-liners. I have
    a separate notes file in the backup area, and all the one-liners
    are copy/pasted in there. Copy a line from that file, into a
    separate Notepad, edit the details as required, then paste it raw
    into the Terminal window, and then all the side effects are visible
    on the screen.

    It's like code inspection, doing it that way. Anything moving data
    around, deserves extra eyeballs.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Wed Apr 2 12:36:02 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 11:03 AM, Newyana2 wrote:


      What kinds of things do you do that need console reporting
    mid-script?


    For long running scripts, you could use a bit of progress indication.
    What percent done.

    In the old days, this was the entering of dots on the screen.
    And my favorites were always the programming efforts where
    the "dots went off the side of the screen". Such attention
    to detail :-) The people doing that, didn't know the terminal
    in that case, didn't have autowrap. (Yes, there were actually
    terminal emulators *that* crude.)

    In my Robocopy command, you can see I like to use the output
    as a form of progress indication, as well as making a
    permanent log.

    robocopy Y:\ F:\ /mir /COPYALL /dcopy:t /XJ /r:3 /w:2 /zb /np /tee /v /log:robocopy_y_to_f.log

    /tee # Log to screen, log to file
    /v # Verbose
    /log:robocopy_y_to_f.log # Each run gets a logfile (for unique src:dest pairs)

    You don't actually look at that. The idea is, you open a Terminal, paste
    the command, then... watch that the run has started OK. Iconify. Open
    the Terminal after ten minutes, inspect and see it's still on target.
    Iconify. You can use Task Manager or the disk LED, to identify the
    command is thoroughly done.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to R.Wieser on Wed Apr 2 12:41:05 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 12:13 PM, R.Wieser wrote:
    Paul,

    That return() is on main().

    Yes, and ?

    It's the same as exit().

    Execution does not continue past that point.

    Your example doesn't show a "return()" of any kind. Nor a "main()" for that matter...

    Bad examples are bad. :-(

    Regards,
    Rudy Wieser



    Um, that was a code snippet.

    It is showing the CoPilot choice of an error handling pattern.

    If that was a subroutine or function call, the caller could
    do the analysis of the return value.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Paul on Wed Apr 2 13:07:48 2025
    XPost: alt.comp.os.windows-11

    On 4/2/2025 12:36 PM, Paul wrote:
    On Wed, 4/2/2025 11:03 AM, Newyana2 wrote:


      What kinds of things do you do that need console reporting
    mid-script?


    For long running scripts, you could use a bit of progress indication.
    What percent done.

    In the old days, this was the entering of dots on the screen.
    And my favorites were always the programming efforts where
    the "dots went off the side of the screen". Such attention
    to detail :-) The people doing that, didn't know the terminal
    in that case, didn't have autowrap. (Yes, there were actually
    terminal emulators *that* crude.)

    In my Robocopy command, you can see I like to use the output
    as a form of progress indication, as well as making a
    permanent log.

    robocopy Y:\ F:\ /mir /COPYALL /dcopy:t /XJ /r:3 /w:2 /zb /np /tee /v /log:robocopy_y_to_f.log

    /tee # Log to screen, log to file
    /v # Verbose
    /log:robocopy_y_to_f.log # Each run gets a logfile (for unique src:dest pairs)

    You don't actually look at that. The idea is, you open a Terminal, paste
    the command, then... watch that the run has started OK. Iconify. Open
    the Terminal after ten minutes, inspect and see it's still on target. Iconify. You can use Task Manager or the disk LED, to identify the
    command is thoroughly done.

    Paul


    I haven't really run into such situations. On rare occasions I
    might have a script where I'm surprised at the slow speed. But
    I just optimize as much as possible and live with it. Usually scripts
    like that are one-time operations.

    I have found some surprising details about speed with VBS.
    For example, with a lot of text it's much faster to put each small
    string into an array and then run a Join than to keep concatenating
    little strings past the point of petty cash memory reserveed by WSH.

    Another surprising difference is that if a lot of string operations
    are to be done then it's good to convert it to UCase or LCase
    first.

    Once I've done those kinds of optimizations, and I know the
    script works, I'm happy to just let it do its work. I don't need
    to see a progress bar. I could, theoretically, set up a GUI progress
    bar, but even if I cared, getting accurate percentage of progress
    is usually not possible.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to Paul on Wed Apr 2 17:36:51 2025
    XPost: alt.comp.os.windows-11

    Paul <nospam@needed.invalid> wrote:
    On Wed, 4/2/2025 8:41 AM, Frank Slootweg wrote:
    Paul <nospam@needed.invalid> wrote:
    On Wed, 4/2/2025 2:50 AM, Steve Hayes wrote:
    [...]
    I'm not sure what you're saying here.

    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Note that (this part of) the discussion is for .bat files which mainly contain a single 'complicated' command, so the user does not have to remember the complicated command, but just the name of hir .bat file.

    For *such* a .bat file, if the command fails, it will give the same error(s) as if the command was typed manually, so there's no need for checking the error number.

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Yes, scripting - i.e. also .bat files - is "programming", but for
    simple .bat files, such are under discussion here, there's no need to
    make things more complicated than just putting the 'complicated' command
    in a .bat file.

    [...]


    Well, someone is expressing an interest in scripting, and I don't
    want them picking up any bad habits.

    Fair enough. Just as long we agree that there's nothing wrong with
    Steve's method.

    I use a different approach than Steve, for one-liners. I have
    a separate notes file in the backup area, and all the one-liners
    are copy/pasted in there. Copy a line from that file, into a
    separate Notepad, edit the details as required, then paste it raw
    into the Terminal window, and then all the side effects are visible
    on the screen.

    Again, fair enough, different strokes for different folks.

    FWIW, if the task and parameters are static, I use a .bat file instead
    of copy and paste.

    And my 'one-liners' are two or more lines, because they start with
    '@echo off'! :-)

    It's like code inspection, doing it that way. Anything moving data
    around, deserves extra eyeballs.

    "code inspection"!? *I* wrote it, so it's purrfect!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Steve Hayes on Wed Apr 2 10:43:15 2025
    XPost: alt.comp.os.windows-11

    On Wed, 02 Apr 2025 08:50:34 +0200, Steve Hayes wrote:
    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    You left out one very big thing to remember: whenever you change
    which files are synched by one of those .bat files, you must remember
    to change the other three. Having to do redundant maintenance is a
    fruitful source of bugs.

    I know, it's your files and you will surely remember to do the extra
    work. It's a pain to do it four times, but probably not a major pain.

    Being a fanatic about avoiding duplicate maintenance, I went a
    different way. I have one file (fdrv.btm) for synching all files, and
    a second (usb.btm) for synching just the small subset of files that I
    work on often. Each of those requires an argument /frompc or /topc to
    determine the direction of the copy, and accepts additional options
    like /L. A separate file (robowrap.btm) is called by usb.btm or
    fdrv.btm. It uses /frompc or /topc and other arguments passed by the
    two main files, adds always-used arguments like /XO and the log file,
    calls robocopy, and checks the return status.

    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Paul on Wed Apr 2 10:50:36 2025
    XPost: alt.comp.os.windows-11

    On Wed, 2 Apr 2025 04:15:57 -0400, Paul wrote:

    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Here, my personal copy program returns a value of "1", if the source file cannot be opened. This clause was written by an AI by the way.
    "It doesn't have to make sense", as the AI would tell you :-)
    What the AI didn't tell me, is there is a bug in one of the
    library routines I should know about.

    What is the bug, Paul? Or were you just referrng to your initial
    version losing %ERRORLEVEL% because you didn't save it before running
    a DIR command?

    # part of paulcopy64.exe source code... Mostly written by an AI.
    # I only fix them up and make them work. The comment is written by the AI.

    // Open the source file in binary mode
    FILE *source = fopen64(argv[1], "rb");
    if (!source) {
    perror("Error opening source file");
    return 1;
    }

    Now, we test in a Command Prompt, and see if the returned integer
    error code, is arriving OK or not. It is. If each error has a
    different integer number, you can tell the error types apart,
    with numeric checks of %errorlevel% .

    paulcopy64 a b
    Error opening source file: No such file or directory

    echo %errorlevel%
    1 # Om my! My copy did not proceed.

    Making a batch file is not "just making a laundry list".
    It needs conditional checks (somehow) of each
    stage of the operation. And in my C program snippet, you can see
    the AI is doing the same thing. The AI assumes I will be scripting
    calls to "paulcopy64.exe" and scripting needs the number, to check
    the program run went OK.

    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they are lost,
    by the next utility program loading its success or failure status
    into that single variable in the shell.

    Look at the following and note my handling mistake. The error result
    from the "dir" command, has overwritten the "1" left in the %errorlevel% . There was no error in the "dir" run and the result from it is "0".

    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    The paulcopy64.exe was actually compiled on Ubuntu 23.04
    as a cross compile, as I have not managed to get a good
    mingw64 for Windows set up here. So I just cross-compiled
    it, and that is why the program is 252,122 bytes, when it
    should be a lot smaller for a dumb copy program.

    # Asking Ubuntu to make a 64-bit version of a Windows EXE (a PE32+ EXE file). # The FILE_OFFSET_BITS is to enable 64 bit long length fields and stuff.
    # The compiler package (effectively a script) must be installed for the executable
    # of the compiler, to be found. "x86_64-w64-mingw32-gcc" does not exist by default.
    # This allows my program to have "gobs" of RAM, compiling it this way :-)

    /usr/bin/x86_64-w64-mingw32-gcc -D_FILE_OFFSET_BITS=64 -I/usr/x86_64-w64-mingw32/include -o paulcopy64.exe paulcopy64.c

    Paul



    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stan Brown@21:1/5 to Steve Hayes on Wed Apr 2 11:11:18 2025
    XPost: alt.comp.os.windows-11

    On Wed, 02 Apr 2025 08:50:34 +0200, Steve Hayes wrote:
    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    When I write a batch file with complicated command-line syntax, I
    always use this pattern:

    if "%1" != "/?" goto 000_Start
    :: Display syntax with ECHO commands
    exit

    :000_Start
    :: the actual program

    That's TCCLE syntax, but you get the idea.

    It can be a nuisance to update the help message when I update the
    program arguments(*) but it's also a useful opportunity to look back
    and see if there's a better way to do the job than I knew when I
    wrote the file.

    (*) See my rant about duplicate maintenance in
    Message-ID: <MPG.4257170d2253240a9903d9@news.individual.net>

    --
    Stan Brown, Tehachapi, California, USA https://BrownMath.com/
    Shikata ga nai...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Apr 2 20:27:53 2025
    XPost: alt.comp.os.windows-11

    Paul,

    [quote]
    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they
    are lost,
    ...
    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    On the other hand, you should not contuinue (after the failed copy) when
    you are getting an error ...
    [/quote]

    Um, that was a code snippet.

    I seem to be missing something.. Could you point out your "code snippet" in the above ?

    Yes, thats quoted from my reply to you talking about %errorlevel% losing its failure code.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Char Jackson@21:1/5 to the_stan_brown@fastmail.fm on Wed Apr 2 18:59:14 2025
    XPost: alt.comp.os.windows-11

    On Wed, 2 Apr 2025 10:43:15 -0700, Stan Brown
    <the_stan_brown@fastmail.fm> wrote:

    On Wed, 02 Apr 2025 08:50:34 +0200, Steve Hayes wrote:
    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.

    You left out one very big thing to remember: whenever you change
    which files are synched by one of those .bat files, you must remember
    to change the other three. Having to do redundant maintenance is a
    fruitful source of bugs.

    Just spit balling, but what if the 4 .bat files read their variables
    from a shared .ini file? Edit just the .ini and all of the .bat files
    pick up the change.

    Or combine the 4 .bat files into one, with a shared header section to facilitate single-place editing, plus a command line switch to trigger execution of the proper section.

    I just noticed that I repeatedly focused on variables, for some reason.


    I know, it's your files and you will surely remember to do the extra
    work. It's a pain to do it four times, but probably not a major pain.

    Being a fanatic about avoiding duplicate maintenance, I went a
    different way. I have one file (fdrv.btm) for synching all files, and
    a second (usb.btm) for synching just the small subset of files that I
    work on often. Each of those requires an argument /frompc or /topc to >determine the direction of the copy, and accepts additional options
    like /L. A separate file (robowrap.btm) is called by usb.btm or
    fdrv.btm. It uses /frompc or /topc and other arguments passed by the
    two main files, adds always-used arguments like /XO and the log file,
    calls robocopy, and checks the return status.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to Paul on Thu Apr 3 05:24:44 2025
    XPost: alt.comp.os.windows-11

    On Wed, 2 Apr 2025 04:15:57 -0400, Paul <nospam@needed.invalid> wrote:

    On Wed, 4/2/2025 2:50 AM, Steve Hayes wrote:
    I have four batch files:

    dsk2flsh.bat
    flsh2lap.bat
    lap2flsh.bat
    flsh2dsk.bat

    I only have to remember the exact syntax when I make the batch files,
    and after that I I have to remember is the name of the batch file.



    When those .bat files copy things, do you check
    the "error number" to see if the copy
    was successful ?

    Scripting is "programming", and the same things I would
    have to check when writing a C language program, those
    are still issues when running a (so-called OS) copy program.

    Here, my personal copy program returns a value of "1", if the source file >cannot be opened. This clause was written by an AI by the way.
    "It doesn't have to make sense", as the AI would tell you :-)
    What the AI didn't tell me, is there is a bug in one of the
    library routines I should know about.

    My problems have been with the target file.

    Sometimes, after the batch file has called the copy program (xxcopy in
    the case of the desktop computer, Robocopy in the case of the laptop),
    the file copied from the flash drive to the computer will not open.

    When that has happened, I have recopied the file using Norton
    Commander, and then it has opened.

    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu Apr 3 08:39:07 2025
    XPost: alt.comp.os.windows-11

    Democrat,

    Sometimes ... the file copied from the flash drive to the
    computer will not open.
    ...
    You need to post the content of your batch file(s). Don't
    expect people here to have ESP to read your mind.

    Why ? Do you have any knowledge to how a batchfile will possibly interfere with the copying process - or even damage the copied file all by itself ?

    Don't expect people here to have ESP to read your mind. If you have
    knowledge like that you really need to include it in your post.


    Also, why only asking for the batchfile(s) and not (the sourcecode of) both coping programs well as the OS('es) involved and the hardware schematics of both machines and the flash drive too ?

    Yeah, there are a *lot* of places where it could go wrong. Including
    PEBKAC.

    Heck, we do not even know what the damage to the copied file is. It would
    be telling if its always the tail of the file thats missing ...


    Also, leave your political views at the door. This newsgroup is for Win10.
    If you want to fight about political views - or being told how right you
    are - than there are several newsgroups for just that purpose.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Thu Apr 3 04:14:35 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 1:07 PM, Newyana2 wrote:

       I haven't really run into such situations. On rare occasions I
    might have a script where I'm surprised at the slow speed. But
    I just optimize as much as possible and live with it. Usually scripts
    like that are one-time operations.

      I have found some surprising details about speed with VBS.
    For example, with a lot of text it's much faster to put each small
    string into an array and then run a Join than to keep concatenating
    little strings past the point of petty cash memory reserveed by WSH.

      Another surprising difference is that if a lot of string operations
    are to be done then it's good to convert it to UCase or LCase
    first.

       Once I've done those kinds of optimizations, and I know the
    script works, I'm happy to just let it do its work. I don't need
    to see a progress bar. I could, theoretically, set up a GUI progress
    bar, but even if I cared, getting accurate percentage of progress
    is usually not possible.

    The OS is chock full of examples of "energy waste working up data
    for progress indicators" and "indicators that were nuts".

    I like the CHKDSK one that says "15 minute remaining" and one
    second later, the command run is finished. Now, that's a progress
    indicator.

    The progress shown in Macrium is not bad, with the exception
    that some operations have text telling you the transfer rate
    and others, do not.

    You can get rough indications of progress, using Task Manager
    and adding "I/O Read Bytes" and "I/O Write Bytes" columns. If you
    know a command of yours will be doing 70GB of transfers, you
    can check Task Manager and "see how much work it has done",
    to get some idea how much is left to do.

    The performance counters on Windows, don't work for everything,
    so some attempts to add instrumentation to your screen, just
    aren't going to work. You can set up a perfmon.msc screen
    to monitor rates. One of the tricks there, is setting the Y axis
    scaling, so the results fit on the screen properly.

    For disk read/write, I set the graph axis to "800000" which
    is apparently 8GB/sec, so that my 2GB/sec and 3GB/sec activities
    can be seen. This is my little paulcopy64.exe program, copying
    a file (because it's a dumb little program). It uses fread and fwrite.
    The storage device can do 6.5GB/sec, so the result indicates
    my program needs work.

    [Picture]

    https://i.postimg.cc/wxncp9r5/perfmon-msc.gif

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to R.Wieser on Thu Apr 3 03:22:13 2025
    XPost: alt.comp.os.windows-11

    On Wed, 4/2/2025 2:27 PM, R.Wieser wrote:
    Paul,

    [quote]
    In scripting, you have to be careful with "volatile" items
    like an %errorlevel% . They must be copied before they
    are lost,
    ...
    paulcopy64 a b
    Error opening source file: No such file or directory

    dir
    Volume in drive D

    Directory of D:\
    Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe

    echo %errorlevel%
    0 # Oops! I lost my copy failure code.

    On the other hand, you should not contuinue (after the failed copy) when
    you are getting an error ...
    [/quote]

    Um, that was a code snippet.

    I seem to be missing something.. Could you point out your "code snippet" in the above ?

    Yes, thats quoted from my reply to you talking about %errorlevel% losing its failure code.

    Regards,
    Rudy Wieser


    So as it turns out, it's more complicated than I thought. There is ERRORLEVEL and %errorlevel% does not actually exist. But there is a potential fallback behavior for creating it anyway.

    https://devblogs.microsoft.com/oldnewthing/20080926-00/?p=20743

    "Now, it does happen to be the case that if command extensions are enabled and you say %ERRORLEVEL%,
    then the command processor first looks for an environment variable called ERRORLEVEL, and if it
    can’t find one, then it replaces %ERRORLEVEL% with the current value of the internal error level value.
    It’s a fallback step, in the same way that your neighbor is a fallback delivery location if you aren’t home.
    If you file a change-of-address form for yourself, that doesn’t affect packages sent to your neighbor. "

    *******

    paulcopy64 a b
    Error opening source file: No such file or directory

    if ERRORLEVEL 1 echo Does this print?
    Does this print?

    paulcopy64 a b
    Error opening source file: No such file or directory

    if ERRORLEVEL 0 echo Does this print?
    Does this print?

    So something is wrong here.

    paulcopy64 a b
    Error opening source file: No such file or directory

    echo %errorlevel%
    1

    If I create an "a" file, we can try again. This is to check
    that the value is actually coming from the program.

    paulcopy64 a b
    file_size = 0
    Prepare buffer...
    Starting run...
    some_size read = 0
    Read 0 bytes in 000.001292 seconds
    some_size write = 0
    Wrote 0 bytes in 000.001744 seconds
    File copied successfully.


    echo %errorlevel%
    0

    I guess the only way to prove something works then, is to
    write a script and expect different behavior inside ??? I don't
    have the key mentioned here, there is no HKCU Command Processor in W11.

    HKCU\Software\Microsoft\Command Processor
    EnableExtensions DWORD 1 # enabled

    cmd /y disables command extensions for this cmd session
    cmd /x enables command extensions for this cmd session

    It turns out the key does already exist, but it is at this
    location, making it machine wide and it is enabled.

    HKLM\Software\Microsoft\Command Processor
    EnableExtensions DWORD 1 # enabled

    Now I can run my script

    @;echo off
    paulcopy64 a b
    if ERRORLEVEL 1 echo The result is 1 and this is bad

    With the "a" file missing, it prints

    myscript.bat
    Error opening source file: No such file or directory
    The result is 1 and this is bad

    With the "a" file present, it does not print, at the script level,
    so ERRORLEVEL is something other than 1.

    myscript.bat
    file_size = 0
    Prepare buffer...
    Starting run...
    some_size read = 0
    Read 0 bytes in 000.001170 seconds
    some_size write = 0
    Wrote 0 bytes in 000.001974 seconds
    File copied successfully.

    If I change the script to

    @;echo off
    paulcopy64 a b
    echo %errorlevel%

    the value is falling through as Raymond explained.

    myscript.bat
    Error opening source file: No such file or directory
    1

    If I change the script to

    @;echo off
    paulcopy64 a b
    if "%errorlevel%"=="1" echo The result is 1

    and run with no "a" file

    myscript.bat
    Error opening source file: No such file or directory
    The result is 1

    Exciting. Let's see what this does.

    @;echo off
    set globalvar=The value is
    paulcopy64 a b
    set globalvar=%globalvar% %errorlevel%
    REM The dot removes the leading space character
    echo.%globalvar%
    echo This is a test

    gives an output of

    myscript.bat
    Error opening source file: No such file or directory
    The value is 1
    This is a test

    And this is why I don't write batchscript. It's
    about as much fun as writing in assembler.

    Ref: Would not have got this far, without a web page.
    It's still like pulling teeth. https://www.tutorialspoint.com/batch_script/batch_script_quick_guide.htm

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Thu Apr 3 13:10:36 2025
    XPost: alt.comp.os.windows-11

    Paul,

    I seem to be missing something.. Could you point out your "code snippet"
    in
    the above ?

    Yes, thats quoted from my reply to you talking about %errorlevel% losing
    its
    failure code.

    Regards,
    Rudy Wieser


    So as it turns out, it's more complicated than I thought. There is
    ERRORLEVEL
    and %errorlevel% does not actually exist.

    Nice to see that you again refuse to reply when I point out something
    obvious. You mostly read like you are quite knowledgabe, but you lose
    points for that behaiviour.

    Also, why did you quote my whole(!) post if you where not intending to
    address any of it ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Paul on Thu Apr 3 08:40:22 2025
    XPost: alt.comp.os.windows-11

    On 4/3/2025 4:14 AM, Paul wrote:

    The OS is chock full of examples of "energy waste working up data
    for progress indicators" and "indicators that were nuts".

    I like the CHKDSK one that says "15 minute remaining" and one
    second later, the command run is finished. Now, that's a progress
    indicator.


    Copy in general shows wacky progress. It seems to be
    based on something like file size. Since it changes depending
    on the file I'd guess that it's not a case of adding up ythe
    total bytes to be copied and dividing by 100. On the other hand,
    I'm rarely doing anything that I have to wait for with script.

    For instance, I regularly process my server logs to replace IP
    address with hostname and location. I processed free records
    from MaxMind, adding location data into an MSI file. (Which is
    actually a database. I love MSIs for this kind of thing. They're
    very fast and can handle vast data.) So my script will take each
    IP make a hostname call through my own component, do a
    lookup in the location database, then update the array item in
    the array of server log lines. On XP it took several minutes. On
    10 it's much faster. (Maybe faster network operations?) But it
    really doesn't matter. I'm not waiting for it. I'm doing other things
    while it runs.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Thu Apr 3 15:55:55 2025
    XPost: alt.comp.os.windows-11

    On Thu, 3 Apr 2025 06:00:19 +0000, Democrat <Democrat@invalid.invalid>
    wrote:

    On 03/04/2025 04:24, Steve Hayes wrote:


    My problems have been with the target file.

    Sometimes, after the batch file has called the copy program (xxcopy in
    the case of the desktop computer, Robocopy in the case of the laptop),
    the file copied from the flash drive to the computer will not open.

    When that has happened, I have recopied the file using Norton
    Commander, and then it has opened.


    You need to post the content of your batch file(s). Don't expect people
    here to have ESP to read your mind. We are in 2025 and witchcraft, magic
    and religion is never practised unless you are a politician.

    I wasn't asking anyone to debug my batch files. I got into this
    discussion by pointing out that I doing have to type our a series of
    commands in the command line, I put them into a batch file, and
    therefore a batch file is a kind of script.

    The error I referred to appears to be in one of the utes* called by
    the batch file.

    * if applications can be called "apps" surely utilities can be called
    "utes"?




    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to Steve Hayes on Thu Apr 3 15:06:34 2025
    XPost: alt.comp.os.windows-11

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    [...]

    * if applications can be called "apps" surely utilities can be called
    "utes"?

    Utes are big things and apps are normally small things. But you can
    call anything, anything you like, so 'utes' it is! :-)

    <https://www.google.com/search?q=define%3A+ute>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Char Jackson@21:1/5 to All on Thu Apr 3 11:00:52 2025
    XPost: alt.comp.os.windows-11

    On Thu, 03 Apr 2025 15:55:55 +0200, Steve Hayes <hayesstw@telkomsa.net>
    wrote:

    The error I referred to appears to be in one of the utes* called by
    the batch file.

    * if applications can be called "apps" surely utilities can be called
    "utes"?

    Utes are the two guys who were falsely accused in My Cousin Vinny.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Fri Apr 4 13:55:29 2025
    XPost: alt.comp.os.windows-11

    On 3 Apr 2025 15:06:34 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    [...]

    * if applications can be called "apps" surely utilities can be called
    "utes"?

    Utes are big things and apps are normally small things. But you can
    call anything, anything you like, so 'utes' it is! :-)

    <https://www.google.com/search?q=define%3A+ute>

    That's in AusE. We call those "bakkies" in SAfE.

    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.



    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to Steve Hayes on Fri Apr 4 12:11:59 2025
    XPost: alt.comp.os.windows-11

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    On 3 Apr 2025 15:06:34 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    [...]

    * if applications can be called "apps" surely utilities can be called
    "utes"?

    Utes are big things and apps are normally small things. But you can
    call anything, anything you like, so 'utes' it is! :-)

    <https://www.google.com/search?q=define%3A+ute>

    That's in AusE. We call those "bakkies" in SAfE.

    For this Dutchie, "bakkies" is perfectly natural.

    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Steve Hayes on Fri Apr 4 08:49:02 2025
    XPost: alt.comp.os.windows-11

    On 4/4/2025 7:55 AM, Steve Hayes wrote:

    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.


    I've always disliked "apps", too. In my memory it originates
    with Apple ads: "There's an app for that." Like all things
    Apple, it's a bit too cute, like talking to a 12 year old girl.
    But now that the term is established, at least it's a way to
    distinguish compiled Win32 software executables from
    Metro/WinRT/UWP applets.

    Microsoft have a long history of butchering the English
    language with tasteless marketing. WinME was supposed
    to be pronounced, and written, "Windows Me". But they
    couldn't quite swallow their own sleaze, so the logo was a
    lowercase e, but as high as the M. Then there was
    "solutions" as a substitute for "projects" -- marketing the
    software before it's even written.

    My favorite all-time gibberish: "Leveraging solutions across
    the enterprise". (Translation: Using software at work.)

    My favorite example of shooting themselves in the foot:
    "Hailstorm" as a name for a set of online services.

    Their latest obnoxious gimmick is "experiences":

    "Windows also provides experiences that connect to the
    internet to provide additional capabilities. These
    connected experiences can help you in various ways."

    It's an interesting choice. The term seems to assume
    that Windows customers tend to feel that they're "missing
    the boat" in their life. Numb. So all Microsoft products are
    called "experiences". Not only can you write a letter with
    Office365. It will enrich your life so that you don't feel like
    such a loser. Always dreamed of climbing Everest or touring
    the national parks, but you never got around to it? Not to
    worry. You can use Outlook, which is just as good. "You
    can have a rich, fulfilling life, for only 15 bucks a month."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don_from_AZ@21:1/5 to Frank Slootweg on Fri Apr 4 10:32:35 2025
    XPost: alt.comp.os.windows-11

    Frank Slootweg <this@ddress.is.invalid> writes:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    On 3 Apr 2025 15:06:34 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    [...]

    * if applications can be called "apps" surely utilities can be called
    "utes"?

    Utes are big things and apps are normally small things. But you can
    call anything, anything you like, so 'utes' it is! :-)

    <https://www.google.com/search?q=define%3A+ute>

    That's in AusE. We call those "bakkies" in SAfE.

    For this Dutchie, "bakkies" is perfectly natural.

    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!
    Just to muddy the waters,

    "Utes" are an Indigenous people of the Great Basin and Colorado
    Plateau in present-day Utah, western Colorado, and northern New
    Mexico.[7][3] Historically, their territory also included parts of
    Wyoming, eastern Nevada, and Arizona.

    https://en.wikipedia.org/wiki/Ute_people
    --
    -Don_from_AZ-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Sat Apr 5 05:20:38 2025
    XPost: alt.comp.os.windows-11

    On 4 Apr 2025 12:11:59 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!

    It's part of the fight-back against the trend to call utilities
    "apps".


    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Hayes@21:1/5 to All on Sat Apr 5 05:29:00 2025
    XPost: alt.comp.os.windows-11

    On Fri, 4 Apr 2025 08:49:02 -0400, Newyana2 <newyana@invalid.nospam>
    wrote:

    On 4/4/2025 7:55 AM, Steve Hayes wrote:

    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.


    I've always disliked "apps", too. In my memory it originates
    with Apple ads: "There's an app for that." Like all things
    Apple, it's a bit too cute, like talking to a 12 year old girl.
    But now that the term is established, at least it's a way to
    distinguish compiled Win32 software executables from
    Metro/WinRT/UWP applets.

    Microsoft have a long history of butchering the English
    language with tasteless marketing. WinME was supposed
    to be pronounced, and written, "Windows Me". But they
    couldn't quite swallow their own sleaze, so the logo was a
    lowercase e, but as high as the M. Then there was
    "solutions" as a substitute for "projects" -- marketing the
    software before it's even written.

    Yes, that one has always annoyed me. Advertising "solutions" is
    meaningless of you don't know what the problem is.


    My favorite all-time gibberish: "Leveraging solutions across
    the enterprise". (Translation: Using software at work.)

    My favorite example of shooting themselves in the foot:
    "Hailstorm" as a name for a set of online services.

    Their latest obnoxious gimmick is "experiences":

    "Windows also provides experiences that connect to the
    internet to provide additional capabilities. These
    connected experiences can help you in various ways."

    It's an interesting choice. The term seems to assume
    that Windows customers tend to feel that they're "missing
    the boat" in their life. Numb. So all Microsoft products are
    called "experiences". Not only can you write a letter with
    Office365. It will enrich your life so that you don't feel like
    such a loser. Always dreamed of climbing Everest or touring
    the national parks, but you never got around to it? Not to
    worry. You can use Outlook, which is just as good. "You
    can have a rich, fulfilling life, for only 15 bucks a month."

    And then there's UX (User Experience), which usually means that
    programmers and web designers are obsessed with bells and whistles and
    ignore pistons and cylinders. So the main user experience is
    frustration, because the damned thing doesn't actually DO anything,
    but just sits on the screen preening itself.





    And my main user experience is frustration
    --
    Steve Hayes from Tshwane, South Africa
    Web: http://www.khanya.org.za/stevesig.htm
    Blog: http://khanya.wordpress.com
    E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Sat Apr 5 00:37:42 2025
    XPost: alt.comp.os.windows-11

    On Fri, 4/4/2025 8:49 AM, Newyana2 wrote:


      It's an interesting choice. The term seems to assume
    that Windows customers tend to feel that they're "missing
    the boat" in their life. Numb. So all Microsoft products are
    called "experiences". Not only can you write a letter with
    Office365. It will enrich your life so that you don't feel like
    such a loser. Always dreamed of climbing Everest or touring
    the national parks, but you never got around to it? Not to
    worry. You can use Outlook, which is just as good. "You
    can have a rich, fulfilling life, for only 15 bucks a month."


    Your computer is about to call you Emily.

    https://store-images.s-microsoft.com/image/apps.53040.13623743226081137.36b6be7c-6a3b-4414-b1d9-f1b3eb178dea.1e9fda02-60ba-4925-a841-ab921b2841fd?h=768

    Without using Recall, CoPilot has another way of watching your desktop.
    And your camera input, if you connect a camera to the PC.

    https://www.tomshardware.com/software/windows/microsoft-celebrates-its-50th-anniversary-by-letting-copilot-see-what-you-see

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to Steve Hayes on Sat Apr 5 00:44:53 2025
    XPost: alt.comp.os.windows-11

    On 4/4/25 8:20 PM, Steve Hayes wrote:
    On 4 Apr 2025 12:11:59 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!

    It's part of the fight-back against the trend to call utilities
    "apps".


    One of my programs is 13885 lines long. Some folk still
    call it a "script" because it is written in Raku (Perl 6)

    Five lines is a script. 13885 line is a program. I do
    not care what language it is written in,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Steve Hayes on Sat Apr 5 08:26:49 2025
    XPost: alt.comp.os.windows-11

    On 4/4/2025 11:29 PM, Steve Hayes wrote:

    And then there's UX (User Experience), which usually means that
    programmers and web designers are obsessed with bells and whistles and
    ignore pistons and cylinders. So the main user experience is
    frustration, because the damned thing doesn't actually DO anything,
    but just sits on the screen preening itself.


    That's one I hadn't thought of. I've been only vaguely aware
    of "UX". But you're right. The idea of interface design as marketing
    scam is so widespread that they wanted an acronym for it. Design
    used to mean thoughtful planning to put buttons and menus in
    intuitive locations. Now it's more likely to mean steering the
    enduser toward a particular entertainment usage.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to Paul on Sat Apr 5 08:18:10 2025
    XPost: alt.comp.os.windows-11

    On 4/5/2025 12:37 AM, Paul wrote:

    Your computer is about to call you Emily.

    https://store-images.s-microsoft.com/image/apps.53040.13623743226081137.36b6be7c-6a3b-4414-b1d9-f1b3eb178dea.1e9fda02-60ba-4925-a841-ab921b2841fd?h=768

    Without using Recall, CoPilot has another way of watching your desktop.
    And your camera input, if you connect a camera to the PC.

    https://www.tomshardware.com/software/windows/microsoft-celebrates-its-50th-anniversary-by-letting-copilot-see-what-you-see


    I expect that a lot of people will like that. Most people
    loathe managing their computer. I have no Copilots and
    no cameras. But if they come back with that sexy Cortana
    babe -- the blue one in the tight onesie with glowing
    transistors on her thighs, and the mindless enthusiasm in her
    eyes that only robots can offer -- then we can talk.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel70@21:1/5 to Steve Hayes on Sun Apr 6 20:20:09 2025
    XPost: alt.comp.os.windows-11

    On 5/04/2025 2:20 pm, Steve Hayes wrote:
    On 4 Apr 2025 12:11:59 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!

    It's part of the fight-back against the trend to call utilities
    "apps".

    I thought 'Utilities' included Gas, Water and Electricity! ;-P
    --
    Daniel70

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to daniel47@eternal-september.org on Sun Apr 6 21:15:24 2025
    XPost: alt.comp.os.windows-11

    On Sun, 6 Apr 2025 20:20:09 +1000
    Daniel70 <daniel47@eternal-september.org> wrote:

    On 5/04/2025 2:20 pm, Steve Hayes wrote:
    On 4 Apr 2025 12:11:59 GMT, Frank Slootweg <this@ddress.is.invalid>
    wrote:

    Steve Hayes <hayesstw@telkomsa.net> wrote:
    But its still short for "utilities" (the U in SUV) so you can just as
    easily use the abbreviation for utility programs on your computer.

    Yes, in future, in the off chance we get stuck in some kind of
    constructive discussion, let's throw in some comments about 'utes'.
    That'll teach them! :-)

    My ute can beat up your ute!

    It's part of the fight-back against the trend to call utilities
    "apps".

    I thought 'Utilities' included Gas, Water and Electricity! ;-P

    I prefer the Stations, at least in the early part. Oh - this isn't the Monopoly strategy forum.


    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)