2014-09-28 18 views
0

这个工作将在Windows 8上运行吗?我已经在Windows 7上进行了测试,但我不确定...我有一个朋友测试它,他说它没有找到正确的路径,但我检查了,命令的语法是相同的,我不不知道为什么会有问题。这是假设%USERPROFILE%\ Documents \我的游戏\见方的陆族\球员和%USERPROFILE%\谷歌驱动器已经我的批处理文件是否与所有计算机兼容?

@echo off 
echo Administrative permissions required. Detecting permissions... 

net session >nul 2>&1 
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed. 
) else (
echo Failure: Current permissions inadequate. Please run as administatior. 
pause >nul 
exit 
) 

echo --------------------------------------------- 
echo Below enter "S" for simple install type or "A" for avanced install type. 
echo (Simple is recommended, only use advanced if you know what your doing!) 
echo --------------------------------------------- 

set /p option=Enter: 
if /i "%option%"=="S" goto simple 
if /i "%option%"=="A" goto advanced 


echo Your entry did not match available options. Try again. 
pause >nul 
exit 

:simple 
mklink /d "%USERPROFILE%\Google Drive\Terraria" "%USERPROFILE%\Documents\My Games\Terraria\Players" 

cd %USERPROFILE%\Google Drive\Terraria\ 
copy /y NUL marker >nul 
cd %USERPROFILE%\Documents\My Games\Terraria\Players 

if exist marker (
    echo Validation of installation complete. Symbolic link functional. 
    del marker 
) else (
    echo SOMETHING WENT WRONG!!!!!!!! 
) 

echo ============== 
echo You Selected Simple. & echo.If there are no errors above, your installation should be complete. 
echo ============== 
pause >nul 
exit 

:advanced 
mkdir "%USERPROFILE%\Google Drive\Terraria" 
mklink /d "%USERPROFILE%\Google Drive\Terraria\Players" "%USERPROFILE%\Documents\My Games\Terraria\Players" 

cd %USERPROFILE%\Google Drive\Terraria\Players 
copy /y NUL marker >nul 
cd %USERPROFILE%\Documents\My Games\Terraria\Players 

if exist marker (
    echo Validation of installation complete. Symbolic link functional. 
    del marker >nul 
) else (
    echo SOMETHING WENT WRONG!!!!!!!! 
) 

echo ============== 
echo You Selected Advanced. & echo.If there are no errors above, your installation should be complete. 
echo ============== 
pause >nul 
exit 
+0

'%USERPROFILE%\ Google Drive \ Terraria'是否已经存在? – JensG 2014-09-28 20:13:17

+0

是的,虽然他的错误是指定的路径无法找到... – RexPRGMER 2014-09-28 20:19:21

回答

0

如果交付的所有路径存在存在....

mklink命令中介绍Vista的脚本将无法在XP/2003上运行。

相关问题