Windows Server 2008 R2 を使用しています。
私のスクリプトは、入力したファイルが存在することを確認してから、移動するファイルが に存在しないことを確認しますrecycleBin.dir
。ファイルを上書きするかどうかの選択もあります。「はい」を選択すると、スクリプトはそれらを移動します。
私の問題は、1 つだけでなく複数のファイルを入力できるようにする必要があることです。
私がやったこと:
@echo off
set param = "%*"
set corb_path=c:\corbeille.dir
set rep_courant = %cd%
:debut
if "%*" == "" goto error
goto path
goto end
:path
cd %corb_path%|| del %corb_path%
if not exist %corb_path%/nul mkdir %corb_path%
cd c:\
if exist %rep_courant%%* goto something
) else (
goto end )
:something
if exist %corb_path%\"%*" goto choice
) else (
goto 1 )
:choice
choice /t 10 /d n /c on /cs /m "fichier "(%*)" file exist in corbeille.dir"
if errorlevel 2 goto 2
if errorlevel 1 goto 1
:1
move %* %corb_path%
shift
goto debut
:2
echo the file has beed deleted
goto end
:error
echo "You need to input something"
:end