Windows 10: A simple batch file...?

Discus and support A simple batch file...? in Windows 10 Network and Sharing to solve the problem; Hi, It's been a while since I delved into the depths of Windows - and long before Windows 10 - but I would like to write a batch file to copy files... Discussion in 'Windows 10 Network and Sharing' started by Nightowl4933, Sep 19, 2019.

  1. A simple batch file...?


    Hi,


    It's been a while since I delved into the depths of Windows - and long before Windows 10 - but I would like to write a batch file to copy files from a folder on my Windows 10 PC to 2 separate folders - one on an SD card and the other on an external hard drive (I have my reasons!)


    There are two complications:


    The files an extension *.xyz and a backup of the same file has the extension *.xyx.backup (not my doing!) and I only want to copy the *.fra files.


    The destination folders have sub-folders named similar to a date, eg "201905" for May 2019 and I would like to use the 'Date modified' value of the files to be copied to place them in the appropriate folder, eg filename1.xyz with a modified date of 12/12/2019 to be copied to the 201912 folder.


    I thought Xcopy would be the way forward - and I can do the simple bit - but not with the complications above.


    Any help would be appreciated, thanks A simple batch file...? :)

    :)
     
    Nightowl4933, Sep 19, 2019
    #1
  2. djmonson Win User

    help with simple batch file

    i want to create a batch file that will:
    move files from 'directory1' to 'directory2'
    if (and only if) the file DOES NOT begin with an underscore

    anyone know how to do this??

    David
     
    djmonson, Sep 19, 2019
    #2
  3. oily_17 Win User
    Batch Files Knowledge Base

    Don't use batch files very much but one I find useful is for creating a list of files in a directory.
    Just copy the text below into Notepad and save as Filelist.bat

    dir /a /-p /o:gen >filelist.txt

    When you run it from a folder it will create a Filelist.txt file,in the same folder, that lists all the files in that folder.Useful when you are too lazy to type all the files out yourself.
     
    oily_17, Sep 19, 2019
    #3
  4. A simple batch file...?

    Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Sep 19, 2019
    #4
Thema:

A simple batch file...?

Loading...
  1. A simple batch file...? - Similar Threads - simple batch file

  2. Simple batch file gets syntax error

    in Windows 10 Gaming
    Simple batch file gets syntax error: My one-line batch file gets the error message :The syntax of the command is incorrect. I'm pretty sure this is not so.As in so many many other cases, Microsoft gives a generic error message that has no apparent connection to what the user is trying to do. As a result, we...
  3. Simple batch file gets syntax error

    in Windows 10 Software and Apps
    Simple batch file gets syntax error: My one-line batch file gets the error message :The syntax of the command is incorrect. I'm pretty sure this is not so.As in so many many other cases, Microsoft gives a generic error message that has no apparent connection to what the user is trying to do. As a result, we...
  4. How to run a simple batch file in windows 10

    in Windows 10 Gaming
    How to run a simple batch file in windows 10: For years, from Windows3.1 to Windows7 I have been able to run simple batch files like something.bat It always executed without any problems.Fast forward to Windows10 pro 22H2 , it does not work anymore : On clicking the 'something.bat' , it shows the same as 'something.txt'...
  5. How to run a simple batch file in windows 10

    in Windows 10 Software and Apps
    How to run a simple batch file in windows 10: For years, from Windows3.1 to Windows7 I have been able to run simple batch files like something.bat It always executed without any problems.Fast forward to Windows10 pro 22H2 , it does not work anymore : On clicking the 'something.bat' , it shows the same as 'something.txt'...
  6. How to run a simple batch file in windows 10

    in Windows 10 Network and Sharing
    How to run a simple batch file in windows 10: For years, from Windows3.1 to Windows7 I have been able to run simple batch files like something.bat It always executed without any problems.Fast forward to Windows10 pro 22H2 , it does not work anymore : On clicking the 'something.bat' , it shows the same as 'something.txt'...
  7. Batch Files

    in Windows 10 Software and Apps
    Batch Files: How do i make it that my batch file puts itself in to startup https://answers.microsoft.com/en-us/windows/forum/all/batch-files/6156404d-20d4-4f58-bee5-14629dbf7b10
  8. Create batch files with Batch?

    in Windows 10 Software and Apps
    Create batch files with Batch?: How to create Batch and VBS files with Batch? So I write a batch file which I then convert to exe that creates new folders in a certain directory and then creates batch and VBS files with a certain content and saves them in the created folder. So it's similar to a program...
  9. Looking to convert simple .batch to an .exe

    in Windows 10 Support
    Looking to convert simple .batch to an .exe: Ive searched and looked at several programs, but all websites look sketchy and dont appear to vet their files. Maybe I'm a little paranoid *Eek here asking for some recommendations. So....suggestions? 154741
  10. Simple batch file driving me nuts

    in Windows 10 Software and Apps
    Simple batch file driving me nuts: All I want to do is check if a folder exists on a network share and if it does, copy a file to it. Should be a piece of cake. Here is my code: Code: @echo on set "newFile=Just a test file.txt" set "hostTarget=\\Kfwserver\HP_D\ShowkeyPlus Data\" if exists "%hostTarget%" copy...

Users found this page by searching for:

  1. write filelist.bat

    ,
  2. simple batch file to copy file