Skip to content

Instantly share code, notes, and snippets.

@hddananjaya
Created April 6, 2019 03:58
Show Gist options
  • Save hddananjaya/3e6c82653158a5248bbe38e0468cbd70 to your computer and use it in GitHub Desktop.
Save hddananjaya/3e6c82653158a5248bbe38e0468cbd70 to your computer and use it in GitHub Desktop.
:: Instantly copy files to VM shared folder
:: usage :
:: share /f file.file
:: share /d dir\
:: share /l
@echo off
set vm_shared_dir="D:\VBox-WinXP-shared\"
if "%1" equ "" (GOTO echo_usage)
if "%1" equ "/f" (
if "%2" equ "" (GOTO echo_usage)
echo %vm_shared_dir%
copy %2 %vm_shared_dir%
GOTO end
)
if "%1" equ "/d" (
if "%2" equ "" (GOTO echo_usage)
xcopy %2 %vm_shared_dir% /O /X /E /H /K
GOTO end
)
if "%1" equ "/l" (
dir %vm_shared_dir% /B
GOTO end
)
:echo_usage
echo share /f file.file
echo share /d dir\
echo share /l
EXIT /B 0
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment