我尝试与 tfs 服务器建立一些连接。我必须在调度程序中运行它,所以我需要提供用户名和密码。
如你看到的。我们使用 tfspreview 版本。使用用户名(LIVE ID mailadres)和密码。
当我删除密码时。有用。缓存中的用户名和密码?我删除了本地应用数据中的缓存!
当我们尝试使用密码时。我们得到以下错误。
TF30064: You are not authorized to access the server.
我们使用的代码。
REM @echo off
REM ... Change the path below. This is the path where the code will be downloaded!
REM Z:
REM cd Backup_TFS_Preview
REM call %VS100COMNTOOLS%\..\..\VC\vcvarsall.bat x86
REM ... Navigate to folder
Z:
cd Backup_TFS_Preview
REM ... Makes folder with date today
mkdir %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4%
REM ... Navigate to folder
cd %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4%
REM ... Add workspace for the folder with date of today
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" workspace /login:username(LiveID mail adres),password /new /server:https://*.tfspreview.com/DefaultCollection %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4% /noprompt
REM ... Get all items from TFS
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" get /recursive /all /noprompt
REM ... Navigate to folder
cd ..
REM ... Zip the folder
C:\TFS_Backup_Scripts\7z.exe a %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4%.zip %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4%\
REM ... Remove folder
rmdir %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4%\ /s /q
REM ... Delete workspace
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf" workspace /delete %Date:~-10,2%-%Date:~-7,2%-%Date:~-4,4% /noprompt
REM ... Navigate to folder
cd ..
cd ..
REM ... Delete zip files that are older then 10 days
forfiles -p "Z:\Backup_TFS_Preview" -s -m *.* -d -10 -c "cmd /c del /q @path"
PAUSE