Solved Copy contents of current folder to a different folder


theyikes

Member
Local time
11:58 PM
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
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

Latest Support Threads

Back
Top Bottom