Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.os.windows-10 > #183090 > unrolled thread
| Started by | Dual Boot Windows <invalid@invalid.invalid> |
|---|---|
| First post | 2025-03-31 02:12 +0100 |
| Last post | 2025-04-01 02:01 -0700 |
| Articles | 20 on this page of 73 — 16 participants |
Back to article view | Back to alt.comp.os.windows-10
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
Page 1 of 4 [1] 2 3 4 Next page →
| From | Dual Boot Windows <invalid@invalid.invalid> |
|---|---|
| Date | 2025-03-31 02:12 +0100 |
| Subject | Re: what is the fastest command line copy? |
| Message-ID | <vsctt2$1c3kf$1@paganini.bofh.team> |
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/> There is a 2 years' old video explaing how to use FastCopy. <https://youtu.be/jkfZoH7QHhs?si=b7_UwTX4RzOrrnbd> Good luck and keep posting comments on YouTube for more videos like this to be produced.
[toc] | [next] | [standalone]
| From | Steve Hayes <hayesstw@telkomsa.net> |
|---|---|
| Date | 2025-03-31 04:43 +0200 |
| Message-ID | <050kujpf36f33i4hspur5jg286m5r7fvn3@4ax.com> |
| In reply to | #183090 |
On Mon, 31 Mar 2025 02:12:05 +0100, Dual Boot Windows <invalid@invalid.invalid> 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/> > 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 -- 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
[toc] | [prev] | [next] | [standalone]
| From | Paul <nospam@needed.invalid> |
|---|---|
| Date | 2025-03-31 00:47 -0400 |
| Message-ID | <vsd6ok$3cut2$1@dont-email.me> |
| In reply to | #183091 |
On Sun, 3/30/2025 10:43 PM, Steve Hayes wrote:
> On Mon, 31 Mar 2025 02:12:05 +0100, Dual Boot Windows
> <invalid@invalid.invalid> 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/>
>>
>
> 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
>
Robocopy is built into the OS.
For WinXP, you have to download a copy, as at the time WinXP
was written, Robocopy was a hobby program. But on any later
OS (Vista+) , it is a built-in part of the Windows OS and
supported by Microsoft.
For help, start a cmd.exe window, then enter
robocopy /?
and that explains the options.
Robocopy is a directory copy program, that can at its smallest,
copy a single file. But it can also copy all the files from
one partition to another partition. It can notch out certain kinds
of files, that would stop other copy programs from finishing a run.
It's also a *dangerous* program. If you mirror (/mir) an empty folder to
a full folder, the full folder can be erased. It has been used, on purpose,
to erase entire partitions (that could not otherwise be erased).
robocopy Y:\ F:\ /mir /COPY:DATSOU /dcopy:t /XJ /r:3 /w:2 /zb /np /tee /v /log:robocopy_y_to_f.log
Via /XD dirs , it can avoid copying a section of a file tree (exclude function).
You can also define an explicit list of items to copy via /job:filename
filename
--------
/IF
file1.ext
file2.ext
file3.ext
where the /IF stands for Include File. I expect there are
details and limitations that are important, or at least,
a need to pretty carefully format the pathname with respect to
the root folder. Those look like relative pathnames with
respect to the original source directory name.
If you're skillful, I would think no fancy .bat looping constructs
would be needed to get Robocopy to do a job of work.
My needs for the thing, were always pretty simple. I don't use it
all that often any more.
If you need to do a "hot" copy, I don't think it creates a
VSS shadow for you, and you would use vssadmin to make a shadow
copy first, assign a drive letter, then robocopy that, then
drop the shadow copy when your copying attempt is finished.
Normally, that would arise if trying to copy the entire C:\
drive and I do not recommend it for performing that function.
Very few fluffy utilities, are suited to verbatim C: copy. To
copy the C: partition, use backup/restore or partition clone
software, which work at a different level, and don't care about
filesystem details because they work closer to the PHY level.
Working at the file system level is always perilous, in terms
of getting all the details right. "Data partitions" are not
normally too bad, except if you're dealing with a twit who
has prepared the partition and put booby-traps in it. Never
use an XCOPY against a forensic opponent. Regular copying
is only appropriate for file trees where no "tricks" have
been used.
Paul
[toc] | [prev] | [next] | [standalone]
| From | Steve Hayes <hayesstw@telkomsa.net> |
|---|---|
| Date | 2025-03-31 11:06 +0200 |
| Message-ID | <anmkuj5chhak0acvhl3a906mbnj0cjd775@4ax.com> |
| In reply to | #183092 |
On Mon, 31 Mar 2025 00:47:15 -0400, Paul <nospam@needed.invalid> wrote: >On Sun, 3/30/2025 10:43 PM, Steve Hayes wrote: >> 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 >> > >Robocopy is built into the OS. > >For WinXP, you have to download a copy, as at the time WinXP >was written, Robocopy was a hobby program. But on any later >OS (Vista+) , it is a built-in part of the Windows OS and >supported by Microsoft. Thanks very much. -- 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
[toc] | [prev] | [next] | [standalone]
| From | Stan Brown <the_stan_brown@fastmail.fm> |
|---|---|
| Date | 2025-03-31 12:10 -0700 |
| Message-ID | <MPG.4254888260f426149903d1@news.individual.net> |
| In reply to | #183092 |
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...
[toc] | [prev] | [next] | [standalone]
| From | "Jonathan N. Little" <lws4art@gmail.com> |
|---|---|
| Date | 2025-04-01 18:56 -0400 |
| Message-ID | <vshque$8k55$1@dont-email.me> |
| In reply to | #183092 |
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. It has been used, on purpose, > to erase entire partitions (that could not otherwise be erased). Been there and *almost* done that. Since its command line args managed to be less intuitive than rsync, what a feat! -- Take care, Jonathan ------------------- LITTLE WORKS STUDIO http://www.LittleWorksStudio.com
[toc] | [prev] | [next] | [standalone]
| From | Newyana2 <newyana@invalid.nospam> |
|---|---|
| Date | 2025-03-31 08:21 -0400 |
| Message-ID | <vse1av$8pa5$1@dont-email.me> |
| In reply to | #183091 |
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.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2025-03-31 15:47 +0200 |
| Message-ID | <vse6e0$e3ib$1@dont-email.me> |
| In reply to | #183108 |
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
[toc] | [prev] | [next] | [standalone]
| From | Newyana2 <newyana@invalid.nospam> |
|---|---|
| Date | 2025-03-31 10:54 -0400 |
| Message-ID | <vsea99$i2o2$1@dont-email.me> |
| In reply to | #183110 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Andy Burns <usenet@andyburns.uk> |
|---|---|
| Date | 2025-03-31 15:59 +0100 |
| Message-ID | <m4vov7F40grU1@mid.individual.net> |
| In reply to | #183111 |
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.
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2025-03-31 17:32 +0200 |
| Message-ID | <vsecjc$kfh4$2@dont-email.me> |
| In reply to | #183111 |
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
[toc] | [prev] | [next] | [standalone]
| From | Steve Hayes <hayesstw@telkomsa.net> |
|---|---|
| Date | 2025-04-01 07:00 +0200 |
| Message-ID | <ljsmujdighbuvcltfh5kihbmnqaqqohern@4ax.com> |
| In reply to | #183111 |
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
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2025-04-01 09:11 +0200 |
| Message-ID | <vsg3j0$2gn58$1@dont-email.me> |
| In reply to | #183132 |
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
[toc] | [prev] | [next] | [standalone]
| From | Paul <nospam@needed.invalid> |
|---|---|
| Date | 2025-04-01 03:44 -0400 |
| Message-ID | <vsg5ht$2ir3e$1@dont-email.me> |
| In reply to | #183132 |
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.
C:\> where dir
INFO: Could not find files for the given pattern(s).
C:\> where cmd
C:\Windows\System32\cmd.exe
C:\> where copy
INFO: Could not find files for the given pattern(s).
C:\> where move
INFO: Could not find files for the given pattern(s).
C:\> 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
[toc] | [prev] | [next] | [standalone]
| From | Newyana2 <newyana@invalid.nospam> |
|---|---|
| Date | 2025-04-01 09:26 -0400 |
| Message-ID | <vsgpfb$36vg6$1@dont-email.me> |
| In reply to | #183132 |
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. :)
[toc] | [prev] | [next] | [standalone]
| From | Steve Hayes <hayesstw@telkomsa.net> |
|---|---|
| Date | 2025-04-02 08:50 +0200 |
| Message-ID | <nanpujlogu6350309ttemlh3u4u3798698@4ax.com> |
| In reply to | #183144 |
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
[toc] | [prev] | [next] | [standalone]
| From | Paul <nospam@needed.invalid> |
|---|---|
| Date | 2025-04-02 04:15 -0400 |
| Message-ID | <vsiro1$1brfi$1@dont-email.me> |
| In reply to | #183155 |
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% .
D:\>paulcopy64 a b
Error opening source file: No such file or directory
D:\>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".
D:\>paulcopy64 a b
Error opening source file: No such file or directory
D:\>dir
Volume in drive D
Directory of D:\
Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe
D:\>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
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2025-04-02 10:35 +0200 |
| Message-ID | <vsistb$1cua7$1@dont-email.me> |
| In reply to | #183158 |
Paul, > In scripting, you have to be careful with "volatile" items > like an %errorlevel% . They must be copied before they > are lost, ... > D:\>paulcopy64 a b > Error opening source file: No such file or directory > > D:\>dir > Volume in drive D > > Directory of D:\ > Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe > > D:\>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
[toc] | [prev] | [next] | [standalone]
| From | Paul <nospam@needed.invalid> |
|---|---|
| Date | 2025-04-02 05:54 -0400 |
| Message-ID | <vsj1h0$1hnn9$1@dont-email.me> |
| In reply to | #183161 |
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, > ... >> D:\>paulcopy64 a b >> Error opening source file: No such file or directory >> >> D:\>dir >> Volume in drive D >> >> Directory of D:\ >> Tue, 03/18/2025 09:56 AM 252,122 paulcopy64.exe >> >> D:\>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
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@is.invalid> |
|---|---|
| Date | 2025-04-02 16:15 +0200 |
| Message-ID | <vsjhfm$222l7$1@dont-email.me> |
| In reply to | #183165 |
Paul, > That return() is on main(). Yes, and ? Regards, Rudy Wieser
[toc] | [prev] | [next] | [standalone]
Page 1 of 4 [1] 2 3 4 Next page →
Back to top | Article view | alt.comp.os.windows-10
csiph-web