diff --git "a/\350\265\24211/fileLink.bat" "b/\350\265\24211/fileLink.bat" index e4f3791..102c34e 100644 --- "a/\350\265\24211/fileLink.bat" +++ "b/\350\265\24211/fileLink.bat" @@ -4,13 +4,13 @@ set flieAttribute="--a--------" set directoryAttribute="d----------" ::rem 设定存放脚本及映射的目录 set mappingPath=%userprofile%\Desktop\LinkBox\ -set CLinkBoxPath=%mappingPath%%~nx1 +set CLinkBoxPath=%mappingPath% ::rem 脚本所在地即为链接生成地 -set tagHome="%~dp0" +set tagHome=%~dp0 set OLinkBoxPath=%~d1\LinkBox\ set Obat=%CLinkBoxPath%跨盘符需管理员权限%~n1.bat ::rem 创建脚本及映射目录 -if exist %CLinkBoxPath% ( echo "%CLinkBoxPath%" ) else ( mkdir %CLinkBoxPath% ) +if exist %CLinkBoxPath% ( echo "%CLinkBoxPath%%~nx1" ) else ( mkdir %CLinkBoxPath% ) ::rem 核验变量 echo attribute:%attribute% ::echo flieAttribute:%flieAttribute% @@ -21,13 +21,13 @@ if "C:"=="%~d1" ( goto intoC ) else ( goto intoO ) :intoC if %flieAttribute%==%attribute% ( - MKLINK /H "%tagHome%" "%~1" + MKLINK /H "%tagHome%%~nx1" "%~1" echo "--a--------H" ) else if %directoryAttribute%==%attribute% ( - MKLINK /J "%tagHome%" "%~1" + MKLINK /J "%tagHome%%~nx1" "%~1" echo "d----------J" ) else ( - MKLINK /D "%tagHome%" "%~1" + MKLINK /D "%tagHome%%~nx1" "%~1" echo "-----------D" ) goto end @@ -45,17 +45,17 @@ if "C:"=="%~d1" ( goto intoC ) else ( goto intoO ) ) > %Obat% if %flieAttribute%==%attribute% ( ( - echo MKLINK "%tagHome%" "%~1" + echo MKLINK "%tagHome%%~nx1" "%~1" echo echo --a--------H ) >> %Obat% ) else if %directoryAttribute%==%attribute% ( ( - echo MKLINK /D "%tagHome%" "%~1" + echo MKLINK /D "%tagHome%%~nx1" "%~1" echo echo d----------J ) >> %Obat% ) else ( ( - echo MKLINK /D "%tagHome%" "%~1" + echo MKLINK /D "%tagHome%%~nx1" "%~1" echo echo -----------D ) >> %Obat% )