Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.os.windows-10 > #183144
| From | Newyana2 <newyana@invalid.nospam> |
|---|---|
| Newsgroups | alt.comp.os.windows-11, alt.comp.os.windows-10 |
| Subject | Re: what is the fastest command line copy? |
| Date | 2025-04-01 09:26 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <vsgpfb$36vg6$1@dont-email.me> (permalink) |
| References | (2 earlier) <050kujpf36f33i4hspur5jg286m5r7fvn3@4ax.com> <vse1av$8pa5$1@dont-email.me> <vse6e0$e3ib$1@dont-email.me> <vsea99$i2o2$1@dont-email.me> <ljsmujdighbuvcltfh5kihbmnqaqqohern@4ax.com> |
Cross-posted to 2 groups.
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. :)
Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: what is the fastest command line copy? Dual Boot Windows <invalid@invalid.invalid> - 2025-03-31 02:12 +0100
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-03-31 04:43 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-03-31 00:47 -0400
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-03-31 11:06 +0200
Re: what is the fastest command line copy? Stan Brown <the_stan_brown@fastmail.fm> - 2025-03-31 12:10 -0700
Re: what is the fastest command line copy? "Jonathan N. Little" <lws4art@gmail.com> - 2025-04-01 18:56 -0400
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-03-31 08:21 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-03-31 15:47 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-03-31 10:54 -0400
Re: what is the fastest command line copy? Andy Burns <usenet@andyburns.uk> - 2025-03-31 15:59 +0100
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-03-31 17:32 +0200
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-01 07:00 +0200
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-01 09:11 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-01 03:44 -0400
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-01 09:26 -0400
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-02 08:50 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 04:15 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 10:35 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 05:54 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 16:15 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 11:40 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 18:13 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 12:41 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 20:27 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-03 03:22 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-03 13:10 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-02 07:57 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 16:19 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-02 11:04 -0400
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 12:04 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 18:06 +0200
Re: what is the fastest command line copy? Frank Slootweg <this@ddress.is.invalid> - 2025-04-02 12:41 +0000
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 12:15 -0400
Re: what is the fastest command line copy? Frank Slootweg <this@ddress.is.invalid> - 2025-04-02 17:36 +0000
Re: what is the fastest command line copy? Stan Brown <the_stan_brown@fastmail.fm> - 2025-04-02 10:50 -0700
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-03 05:24 +0200
Re: what is the fastest command line copy? Democrat <Democrat@invalid.invalid> - 2025-04-03 06:00 +0000
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-03 08:39 +0200
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-03 15:55 +0200
Re: what is the fastest command line copy? Frank Slootweg <this@ddress.is.invalid> - 2025-04-03 15:06 +0000
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-04 13:55 +0200
Re: what is the fastest command line copy? Frank Slootweg <this@ddress.is.invalid> - 2025-04-04 12:11 +0000
Re: what is the fastest command line copy? Don_from_AZ <djatechNOSPAM@comcast.net.invalid> - 2025-04-04 10:32 -0700
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-05 05:20 +0200
Re: what is the fastest command line copy? T <T@invalid.invalid> - 2025-04-05 00:44 -0700
Re: what is the fastest command line copy? Daniel70 <daniel47@eternal-september.org> - 2025-04-06 20:20 +1000
Re: what is the fastest command line copy? "Kerr-Mudd, John" <admin@127.0.0.1> - 2025-04-06 21:15 +0100
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-04 08:49 -0400
Re: what is the fastest command line copy? Steve Hayes <hayesstw@telkomsa.net> - 2025-04-05 05:29 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-05 08:26 -0400
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-05 00:37 -0400
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-05 08:18 -0400
Re: what is the fastest command line copy? Char Jackson <none@none.invalid> - 2025-04-03 11:00 -0500
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-02 07:53 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 16:26 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-02 11:03 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-04-02 18:04 +0200
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-02 12:36 -0400
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-02 13:07 -0400
Re: what is the fastest command line copy? Paul <nospam@needed.invalid> - 2025-04-03 04:14 -0400
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-04-03 08:40 -0400
Re: what is the fastest command line copy? Stan Brown <the_stan_brown@fastmail.fm> - 2025-04-02 10:43 -0700
Re: what is the fastest command line copy? Char Jackson <none@none.invalid> - 2025-04-02 18:59 -0500
Re: what is the fastest command line copy? Stan Brown <the_stan_brown@fastmail.fm> - 2025-04-02 11:11 -0700
Re: what is the fastest command line copy? knuttle <keith_nuttle@yahoo.com> - 2025-03-31 10:59 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-03-31 17:26 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-03-31 13:05 -0400
Re: what is the fastest command line copy? "R.Wieser" <address@is.invalid> - 2025-03-31 20:18 +0200
Re: what is the fastest command line copy? Newyana2 <newyana@invalid.nospam> - 2025-03-31 14:43 -0400
Re: what is the fastest command line copy? Stan Brown <the_stan_brown@fastmail.fm> - 2025-03-31 13:40 -0700
Re: what is the fastest command line copy? T <T@invalid.invalid> - 2025-03-30 23:03 -0700
Re: what is the fastest command line copy? T <T@invalid.invalid> - 2025-03-30 23:43 -0700
Re: what is the fastest command line copy? T <T@invalid.invalid> - 2025-04-01 02:01 -0700
csiph-web