gpt-3.5-turbo-0125· OpenAI
WildChat-4.8M (AI2)
Batch script to copy folder in clipboard
- User
Batch script to copy folder in clipboard
- Assistant
Here is a batch script that can copy a folder that is in the clipboard:
batch@echo off setlocal EnableDelayedExpansion :: Get the clipboard content for /f "tokens=*" %%a in ('powershell -command "Get-Clipboard"') do ( set "clipboard_content=%%a" ) :: Check if the clipboard content is a valid directory if exist "!clipboard_content!\" ( :: Copy the directory to a destination folder xcopy "!clipboard_content!" "C:\DestinationFolder" /E /I echo Folder copied successfully. ) else ( echo Invalid directory path in clipboard. ) pauseSave this code as a
.batfile and run it. It will check if the content in the clipboard is a valid directory path. If it is, it will copy the folder to "C:\DestinationFolder". You can modify the destination folder path as per your requirement.