@echo off
setlocal
rem get the .lnk target directory
for /f "tokens=* usebackq" %%i in (`type "C:UsersAbdoDesktopGravity.lnk" ^| find "" ^| findstr/b "[a-z][:][]"`) do (
set _targetdir=%%~dpi
)
rem copy the files
copy /y Gravity.pdf %_targetdir%
endlocal
@echo off
setlocal
rem get the .lnk target directory
for /f "tokens=* usebackq" %%i in (`type "C:UsersAbdoDesktopGravity.lnk ^| find "" ^| findstr/b "[a-z][:][]"`) do (
set _targetdir=%%~dpi
)
rem copy the files
copy /y Gravity.pdf %_target%
endlocal
@echo off
setlocal
rem get the .lnk target directory
for /f "tokens=* usebackq" %%i in (`type "C:UsersAbdoDesktopGravity.lnk ^| find "" ^| findstr/b "[a-z][:][]"`) do (set _targetdir=%%~dpi)
rem copy the files
copy /y Gravity.pdf %_target%
endlocal
@echo off
setlocal
rem get the .lnk target directory
for /f "tokens=* usebackq" %%i in (`type "C:UsersHomeDesktopExample.lnk" ^| find "" ^| findstr/b "[a-z][:][]"`) do (
set _targetdir=%%~dpi
)
rem copy the files
copy /y file1.exe %_targetdir%
copy /y file2.exe %_targetdir%
endlocal