[Help] Script for creating a folder, and then pasting other folders into it.

Discussion in 'Scripting' started by SalviaSage, Apr 22, 2018.

Tags:
  1. SalviaSage

    SalviaSage MDL Novice

    Apr 9, 2018
    19
    0
    0
    Hi. I got this idea for a .batch script.

    Basically, it makes a folder in a certain directory, only if this folder doesn't exist of course.

    And then, it copies some folders from another directory into it.

    And yes, I seriously need to try to learn batch...
     
  2. TairikuOkami

    TairikuOkami MDL Addicted

    Mar 15, 2014
    687
    540
    30
    Code:
    md "Z:\Pictures"
    xcopy "E:\Software\Temp\Pics" "Z:\Pictures" /s /y
    You can look at those, but CMD is being deprecated soon, you better learn powershell instead.

    https://www.computerhope.com/batch.htm
    https://ss64.com/nt
     
  3. Chibi ANUBIS

    Chibi ANUBIS MDL Chibi Developer

    Apr 28, 2014
    732
    406
    30
    Code:
    @echo off
    SET Source=E:\Software\Temp\Pics
    SET Target=Z:\Pictures
    
    if not exist "%Target%" mkdir "%Target%"
    xcopy "%Source%" "%Target%" /s /y
    
    exit
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. SalviaSage

    SalviaSage MDL Novice

    Apr 9, 2018
    19
    0
    0
    Thanks for your reply. I will be testing this.
     
  5. pf100

    pf100 MDL Expert

    Oct 22, 2010
    1,027
    1,281
    60
    I've never heard of, and can't find, any information about CMD and batch script being removed from windows. Do you have a link?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...