@echo off if "%1"=="debug" echo on REM **** Setup the destination path set chAppend=\ SET lastchar=%HOMEPATH:~-1,1% if '%lastchar%'=='\' set chAppend= set destPath=%HOMEDRIVE%"%HOMEPATH%%chAppend%windows" REM ***** Setup your source area where the RS files are REM ***** This does not have to be a mapped drive net use v: %LOGONSERVER%\netlogon set srcPath=v:\RemoteScan if not exist %destPath%\twain_32\RemoteScan ( if not exist %destPath% mkdir %destPath% copy /Y %srcPath%\twain.dll %destPath%\twain.dll >nul copy /Y %srcPath%\twain_32.dll %destPath%\twain_32.dll >nul if not exist %destPath%\twain_32.dll ( echo - echo Could not copy %srcPath%\twain_32.dll to %destPath%\twain_32.dll echo - pause goto Error ) copy /Y %srcPath%\twunk_16.exe %destPath%\twunk_16.exe >nul copy /Y %srcPath%\twunk_32.exe %destPath%\twunk_32.exe >nul mkdir %destPath%\twain_32 xcopy /Q /I /E /Y /S %srcPath%\twain_32\RemoteScan %destPath%\twain_32\RemoteScan >nul if not exist %destPath%\twain_32\RemoteScan\RemoteScan_client.ds ( echo - echo Files in %srcPath%\twain_32\RemoteScan not copied to %destPath%\twain_32\RemoteScan echo - pause goto Error ) echo RemoteScan setup complete ) ELSE ( echo ** RemoteScan already setup, updating new files xcopy "%srcPath%\twain_32\RemoteScan\RemoteScan_client.ds" %destPath%\twain_32\RemoteScan /d /y xcopy "%srcPath%\twain_32\RemoteScan\RSRDPServerProxy.dll" %destPath%\twain_32\RemoteScan /d /y xcopy "%srcPath%\twain_32\RemoteScan\RSICAServerProxy.dll" %destPath%\twain_32\RemoteScan /d /y ) :end :Error net use v: /del