Solved Copy contents of current folder to a different folder


theyikes

Member
Local time
12:18 AM
Posts
8
OS
11
HI can anyone help me out? I'm trying to copy the contents of a usb drive to a C:\ folder called example. i tried xcopy .\"*\" "C:\example /E /H /C /I
 

My Computer

System One

  • OS
    11
    Computer type
    PC/Desktop
    Manufacturer/Model
    gigabyte
    CPU
    AMD Ryzen 5 4500 6-Core Processor
    Motherboard
    Gigabyte A520M DS3H V2
    Memory
    64gb ddr4
    Graphics Card(s)
    GeForce RTX 3050 8GB
    Monitor(s) Displays
    2
try this. save as a .bat file and place it on the usb drive with the files you want to copy:

Code:
echo off
cmd.exe /C
@setlocal enableextensions 
@cd /d "%~dp0"
xcopy *.* "C:\Example\"
 

My Computer

System One

  • OS
    Windows 11 Pro
that worked perfectly Dacrone. Thanks. I do have one other related question. Should i ask it here or maybe a different topic?
 

My Computer

System One

  • OS
    11
    Computer type
    PC/Desktop
    Manufacturer/Model
    gigabyte
    CPU
    AMD Ryzen 5 4500 6-Core Processor
    Motherboard
    Gigabyte A520M DS3H V2
    Memory
    64gb ddr4
    Graphics Card(s)
    GeForce RTX 3050 8GB
    Monitor(s) Displays
    2
Thanks Dacrone. OK i was wondering if it might be possible to create a desktop shortcut to the executable in the "Example" folder It's not really a problem, i can always do it the old fashioned way,a sin right click....... ya da ya da ya da""
 

My Computer

System One

  • OS
    11
    Computer type
    PC/Desktop
    Manufacturer/Model
    gigabyte
    CPU
    AMD Ryzen 5 4500 6-Core Processor
    Motherboard
    Gigabyte A520M DS3H V2
    Memory
    64gb ddr4
    Graphics Card(s)
    GeForce RTX 3050 8GB
    Monitor(s) Displays
    2
whats the name of the .exe? i'll add it in
 

My Computer

System One

  • OS
    Windows 11 Pro
It's just called new.exe.
 

My Computer

System One

  • OS
    11
    Computer type
    PC/Desktop
    Manufacturer/Model
    gigabyte
    CPU
    AMD Ryzen 5 4500 6-Core Processor
    Motherboard
    Gigabyte A520M DS3H V2
    Memory
    64gb ddr4
    Graphics Card(s)
    GeForce RTX 3050 8GB
    Monitor(s) Displays
    2
It's just called new.exe.
Code:
echo off
cmd.exe /C
@setlocal enableextensions 
@cd /d "%~dp0"
xcopy *.* "C:\Example\"
powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%userprofile%\Desktop\new.lnk');$s.TargetPath='new.exe';$s.Save()"
 

My Computer

System One

  • OS
    Windows 11 Pro
Dacrone! I WISH i could just throw script around like it's walk in the park. You make it seem so easy. Can i ask are you self taught?
 

My Computer

System One

  • OS
    11
    Computer type
    PC/Desktop
    Manufacturer/Model
    gigabyte
    CPU
    AMD Ryzen 5 4500 6-Core Processor
    Motherboard
    Gigabyte A520M DS3H V2
    Memory
    64gb ddr4
    Graphics Card(s)
    GeForce RTX 3050 8GB
    Monitor(s) Displays
    2
yep. but I'm a rookie compared to some of the users here. @pseymour and @garlin are the MVPs for powershell/batch if you need elaborate help in future endeavors.

please mark as solved. thanks.
 

My Computer

System One

  • OS
    Windows 11 Pro
Why not use File Explorer? Highlight the files in the first folder and fhen drag and drop them to the other folder. Use Right Click to choose Copy or Move. I haven't had the need to do this on my Win11 lapfop but I use this method all the time on my Win10 desktop and can't ass why it wouldn't also work on Win11.
 

My Computer

System One

  • OS
    Windows 11 Pro @2N23
    Computer type
    Laptop
    Manufacturer/Model
    Dell
    CPU
    AMD Ryzen 7
    Memory
    16gb
    Hard Drives
    M2 2TB SSD
    Browser
    Edge
    Antivirus
    ioBit

Latest Support Threads

Back
Top Bottom