Windows 10: Powershell script to copy files in order; lost the thread

Discus and support Powershell script to copy files in order; lost the thread in Windows 10 Software and Apps to solve the problem; I'm searching for an old thread in vain. Pretty sure it was in this or the TENFORUM. I had some great help from one of the gurus. He wrote me a... Discussion in 'Windows 10 Software and Apps' started by terrypinVG, Apr 9, 2025.

  1. Powershell script to copy files in order; lost the thread


    I'm searching for an old thread in vain. Pretty sure it was in this or the TENFORUM. I had some great help from one of the gurus. He wrote me a Powershell script that I've used successfully to copy files from File Explorer to an SD card in the order in which they are organised within File Explorer. The application that uses the SD card assigns an 'index' based exclusively on the order in which the files are copied. Copy/pasting, dragging etc proves unreliable for some obscure reason. But the script always does it correctly. However it sems it does not copy folders a their files. I'll describe

    :)
     
    terrypinVG, Apr 9, 2025
    #1
  2. SKC-PSI Win User

    Create a PowerShell script to create a copy

    I am trying to build a process to copy the folders and files on a folder on my computer. I want to create a script using PowerShell so that I can use it from Scheduler to do this consistently. I am unsure how to set up a script to allow this to happen.

    Any help is greatly appreciated.
     
    SKC-PSI, Apr 9, 2025
    #2
  3. Try3 Win User
    Try3, Apr 9, 2025
    #3
  4. Powershell script to copy files in order; lost the thread

    Script can copy file directory in one spot but not the other

    Haha yeah its fred. sorry its 8am and my mind isnt fully functional yet. There is an error along side the one my script posts: No such file or directory at script line 20.(which is the copy line). I pointed the script to one of the sub directories exactly, still wouldnt copy. I created a new sub dir, and copied some of the files from the main directory into the new directory, those wouldnt copy either.

    script:
    Code: #!/usr/bin/perl -w use strict; use warnings; use File::Find; use File::Copy; my $directory="..\\..\\doc\\xsd"; find (\&subr, $directory); sub subr { foreach ($File::Find::name=~/(.*)\.xsd$/) { my $filetobecopied = $File::Find::name; my $newfile = $1 . ".origxsd"; copy($filetobecopied, $newfile) or die "$File::Find::name cannot be copied $!"; chmod 0777, $File::Find::name; open (FILE, "<", $File::Find::name) or die "Cannot open file $!"; print $File::Find::name. "\n"; local $/; my $file=<FILE>; $f=~s/<!--[\w\W^]*?-->//gi; close FILE; open (OUT, ">", $File::Find::name) or die "Cannot write to file $!"; print OUT $f; close OUT; chmod 0444, $File::Find::name; } }[/quote] thanks kreij
     
    Hybrid_theory, Apr 9, 2025
    #4
Thema:

Powershell script to copy files in order; lost the thread

Loading...
  1. Powershell script to copy files in order; lost the thread - Similar Threads - Powershell script copy

  2. Powershell script to copy files in order; lost the thread

    in Windows 10 Gaming
    Powershell script to copy files in order; lost the thread: I'm searching for an old thread in vain. Pretty sure it was in this or the TENFORUM. I had some great help from one of the gurus. He wrote me a Powershell script that I've used successfully to copy files from File Explorer to an SD card in the order in which they are...
  3. Powershell script to copy files in order; lost the thread

    in Windows 10 Customization
    Powershell script to copy files in order; lost the thread: I'm searching for an old thread in vain. Pretty sure it was in this or the TENFORUM. I had some great help from one of the gurus. He wrote me a Powershell script that I've used successfully to copy files from File Explorer to an SD card in the order in which they are...
  4. PowerShell script

    in Windows 10 Support
    PowerShell script: The code below tests a series of IPs in a txt file.The result is as follows and is written in a txt file. 19.191.12.161 - online 19.191.12.162 - offline 19.191.12.163 - offline 19.191.12.164 - offline 19.191.12.165 - offline also see the scrennshot Code: $Output= @()$GetIP =...
  5. Powershell script to copy file to network runs manually, but not from Task Scheduler

    in Windows 10 Network and Sharing
    Powershell script to copy file to network runs manually, but not from Task Scheduler: Hi All, I am trying to copy file from one domain to another domainTrust not enabled. So we made a Powershell script to copy file from sourceone domain to destinationanother domain which works fine when running through powershell console but not from Task Scheduler. We need...
  6. powershell scripts

    in AntiVirus, Firewalls and System Security
    powershell scripts: Hi, I have azure. Someone is somehow installing powershell scripts onto my computer that allows them to host my PC through P2P and UDP connections, well I think so anyway. I have only just found powershell script entry changes in my registry by accident. These criminals...
  7. powershell script

    in Windows 10 Customization
    powershell script: looking for a script to monitor for a folder, if there is a file in that folder send it as an email, once the email is sent out, confirm and then move the files to an archive folder. monitor c:\test\*.pdf No files, do not send email. Yes Files, send an email to someone at...
  8. Files lost in copying

    in Windows 10 Network and Sharing
    Files lost in copying: Hi All! I recently bought a new computer and is trying to copy all my old files to the new computer. After copying, I checked the folder properties and realized that the number of files and folder size is very much reduced. I can understand if folder size is reduced but...
  9. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    Running PowerShell script as a batch file: Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing bloatware***...
  10. PowerShell Scripting - The Basics

    in Windows 10 Tutorials
    PowerShell Scripting - The Basics: How to: PowerShell Scripting - The Basics [img] Information A PowerShell script is a collection of commands and cmdlets to be run in logical order, previous lines in script determining values and variables in command lines thereafter. The principle is the same than in...