好的,所以我一直试图调试这个。发生的情况是,当它映射驱动器时,它不会使用net use t:将驱动器映射到我选择的字母。此外,它每次运行时都会生成越来越多的映射驱动器。因此,如果有人能够提供一些有关此事情的信息,我将非常感谢!
@echo off
color 02
title = Start Crosslink Now
set address= \\192.168.1.147\
:start
set count=0
cls
echo -------------Select a number -------------
echo.
echo 1) Start crosslink 2015
echo 2) Start crosslink 2014
echo 3) Start corsslink 2013
echo 4) Start crosslink 2012
echo 5) Add or Edit Crosslink paths
echo.
set /p a= Select an option:
if %a%==1 goto 15
if %a%==2 goto 14
if %a%==3 goto 13
if %a%==4 goto 12
if %a%==5 goto add
goto exit
:: This is the initial screen for Year selection.
:15
::Checks drive availability. Reattempts connection to drive every 5 seconds.
net use t: %address%xlink15
cls
Echo *****Checking if drive is mapped *****
IF EXIST %address%xlink15 goto 15mounted
IF EXIST %address%xlink15 goto 15mounted
cls
echo The drive couldn't be found attempting again.
timeout /t 5
goto 15
:15mounted
Echo *****STARTING CROSSLINK 2015 SOFTWARE*****
pushd t:
start xlink32.exe
timeout /t 5
echo Going back to Main menu
timeout /t 2
exit
:14
::Checks drive availability. Reattempts connection to drive every 5 seconds.
cls
Echo *****Checking if drive is mapped *****
net use t: %address%xlink14
IF EXIST %address%xlink14 goto 14mounted
IF EXIST %address%xlink14 goto 14mounted
cls
echo The drive couldn't be found attempting again.
timeout /t 5
goto 15
:14mounted
Echo *****STARTING CROSSLINK 2014 SOFTWARE*****
pushd t:
start xlink32.exe
timeout /t 5
timeout /t 2
exit
:13
::Checks drive availability. Reattempts connection to drive every 5 seconds.
net use t: %address%xlink13
cls
Echo *****Checking if drive is mapped *****
IF EXIST %address%xlink13 goto 13mounted%address%
IF EXIST %address%xlink13 goto 13mounted
cls
echo The drive couldn't be found attempting again.
timeout /t 5
goto 15
:13mounted
Echo *****STARTING CROSSLINK 2013 SOFTWARE*****
pushd t:
start xlink32.exe
timeout /t 5
echo Going back to Main menu
timeout /t 2
goto start
:12
::Checks drive availability. Reattempts connection to drive every 5 seconds.
cls
Echo *****Checking if drive is mapped *****
IF EXIST %address%xlink12 goto 12mounted
net use t: %address%xlink12
IF EXIST %address%xlink12 goto 12mounted
cls
echo The drive couldn't be found attempting again.
timeout /t 5
goto 15
:12mounted
Echo *****STARTING CROSSLINK 2012 SOFTWARE*****
pushd t: %address%xlink12
start xlink32.exe
timeout /t 5
echo Going back to Main menu
timeout /t 2
goto start
:add
cls
set /p pass=Enter Password :
if %pass%==work1234 goto createinfo
echo incorect password going back to main menu
timeout /t 2
goto start
:createinfo
cls
Echo ******Set Network Paths******
set /p c15=Enter crosslink 2015 network path:
set /p c14=Enter crosslink 2014 network path:
set /p c13=Enter crosslink 2013 network path:
set /p c12=Enter crosslink 2012 network path:
cls
echo ******Set drive letters******
set /p d15=Enter Drive letter for Crosslink 2015:
set /p d14=Enter Drive letter for Crosslink 2014:
set /p d13=Enter Drive letter for Crosslink 2013:
set /p d12=Enter Drive letter for Crosslink 2012:
cls
goto create
:create
set nme=**
echo @echo off >Start-Crosslink-Now-%nme%.bat
echo color 02 >>Start-Crosslink-Now-%nme%.bat
echo title = Start Crosslink Now >>Start-Crosslink-Now-%nme%.bat
echo :start >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo >>Start-Crosslink-Now-%nme%.bat
echo echo -------------Select a number before------------- >>Start-Crosslink-Now-%nme%.bat
echo echo. >>Start-Crosslink-Now-%nme%.bat
echo echo 1) Start crosslink 2015 >>Start-Crosslink-Now-%nme%.bat
echo echo 2) Start crosslink 2014 >>Start-Crosslink-Now-%nme%.bat
echo echo 3) Start corsslink 2013 >>Start-Crosslink-Now-%nme%.bat
echo echo 4) Start crosslink 2012 >>Start-Crosslink-Now-%nme%.bat
echo echo 5) Add or Edit Crosslink paths >>Start-Crosslink-Now-%nme%.bat
echo echo. >>Start-Crosslink-Now-%nme%.bat
echo set /p a= Select option: >>Start-Crosslink-Now-%nme%.bat
echo if %a%==1 goto 15 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==2 goto 14 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==3 goto 13 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==4 goto 12 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==5 goto add >>Start-Crosslink-Now-%nme%.bat
echo goto exit >>Start-Crosslink-Now-%nme%.bat
echo :15 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c15% goto 15mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d15%: %c15% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c15% goto 15mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :15mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2015 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d15%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :14 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c14% goto 14mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d14%: %c14% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c14% goto 14mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :14mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2014 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d14%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :13 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c13% goto 13mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d13%: %c13% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c13% goto 13mounted >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :13mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2013 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d13% >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :12 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c12% goto 12mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d12%: %c12% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c12% goto 12mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :12mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2012 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d12%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :add >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo set /p pass=Enter Password : >>Start-Crosslink-Now-%nme%.bat
echo if pass==work1234 goto createinfo >>Start-Crosslink-Now-%nme%.bat
echo echo incorect password going back to main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo :createinfo >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo ******Set Network Paths****** >>Start-Crosslink-Now-%nme%.bat
echo set /p c15=Enter crosslink 2015 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c14=Enter crosslink 2014 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c13=Enter crosslink 2013 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c12=Enter crosslink 2012 network path: >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo ******Set drive letters****** >>Start-Crosslink-Now-%nme%.bat
echo set /p d15=Enter Drive letter for Crosslink 2015: >>Start-Crosslink-Now-%nme%.bat
echo set /p d14=Enter Drive letter for Crosslink 2014: >>Start-Crosslink-Now-%nme%.bat
echo set /p d13=Enter Drive letter for Crosslink 2013: >>Start-Crosslink-Now-%nme%.bat
echo set /p d12=Enter Drive letter for Crosslink 2012: >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo goto create >>Start-Crosslink-Now-%nme%.bat
echo :create >>Start-Crosslink-Now-%nme%.bat
set nme=**
echo @echo off >Start-Crosslink-Now-%nme%.bat
echo color 02 >>Start-Crosslink-Now-%nme%.bat
echo title = Start Crosslink Now >>Start-Crosslink-Now-%nme%.bat
echo :start >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo >>Start-Crosslink-Now-%nme%.bat
echo echo -------------Select a number before------------- >>Start-Crosslink-Now-%nme%.bat
echo echo. >>Start-Crosslink-Now-%nme%.bat
echo echo 1) Start crosslink 2015 >>Start-Crosslink-Now-%nme%.bat
echo echo 2) Start crosslink 2014 >>Start-Crosslink-Now-%nme%.bat
echo echo 3) Start corsslink 2013 >>Start-Crosslink-Now-%nme%.bat
echo echo 4) Start crosslink 2012 >>Start-Crosslink-Now-%nme%.bat
echo echo 5) Add or Edit Crosslink paths >>Start-Crosslink-Now-%nme%.bat
echo echo. >>Start-Crosslink-Now-%nme%.bat
echo set /p a= Select option: >>Start-Crosslink-Now-%nme%.bat
echo if %a%==1 goto 15 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==2 goto 14 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==3 goto 13 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==4 goto 12 >>Start-Crosslink-Now-%nme%.bat
echo if %a%==5 goto add >>Start-Crosslink-Now-%nme%.bat
echo goto exit >>Start-Crosslink-Now-%nme%.bat
echo :15 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c15% goto 15mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d15%: %c15% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c15% goto 15mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :15mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2015 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d15%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :14 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c14% goto 14mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d14%: %c14% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c14% goto 14mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :14mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2014 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d14%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :13 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c13% goto 13mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d13%: %c13% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c13% goto 13mounted >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :13mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2013 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d13% >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :12 >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo *****Checking if drive is mapped ***** >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c12% goto 12mounted >>Start-Crosslink-Now-%nme%.bat
echo net use %d12%: %c12% >>Start-Crosslink-Now-%nme%.bat
echo IF EXIST %c12% goto 12mounted >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo The drive couldn't be found attempting again. >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo goto 15 >>Start-Crosslink-Now-%nme%.bat
echo :12mounted >>Start-Crosslink-Now-%nme%.bat
echo Echo *****STARTING CROSSLINK 2012 SOFTWARE***** >>Start-Crosslink-Now-%nme%.bat
echo pushd %d12%: >>Start-Crosslink-Now-%nme%.bat
echo start xlink32.exe >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 5 >>Start-Crosslink-Now-%nme%.bat
echo echo Going back to Main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo :add >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo set /p pass=Enter Password : >>Start-Crosslink-Now-%nme%.bat
echo if pass==work1234 goto createinfo >>Start-Crosslink-Now-%nme%.bat
echo echo incorect password going back to main menu >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo :createinfo >>Start-Crosslink-Now-%nme%.bat >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo Echo ******Set Network Paths****** >>Start-Crosslink-Now-%nme%.bat
echo set /p c15=Enter crosslink 2015 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c14=Enter crosslink 2014 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c13=Enter crosslink 2013 network path: >>Start-Crosslink-Now-%nme%.bat
echo set /p c12=Enter crosslink 2012 network path: >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo ******Set drive letters****** >>Start-Crosslink-Now-%nme%.bat
echo set /p d15=Enter Drive letter for Crosslink 2015: >>Start-Crosslink-Now-%nme%.bat
echo set /p d14=Enter Drive letter for Crosslink 2014: >>Start-Crosslink-Now-%nme%.bat
echo set /p d13=Enter Drive letter for Crosslink 2013: >>Start-Crosslink-Now-%nme%.bat
echo set /p d12=Enter Drive letter for Crosslink 2012: >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo goto create >>Start-Crosslink-Now-%nme%.bat
echo :exit >>Start-Crosslink-Now-%nme%.bat
echo cls >>Start-Crosslink-Now-%nme%.bat
echo echo Incorrect selection redirecting to main screen >>Start-Crosslink-Now-%nme%.bat
echo timeout /t 2 >>Start-Crosslink-Now-%nme%.bat
echo goto start >>Start-Crosslink-Now-%nme%.bat
echo exit >>Start-Crosslink-Now-%nme%.bat
exit
:exit
cls
echo incorrect selection redirecting to main screen
timeout /t 2
goto start
答案 0 :(得分:0)
好的,我修好了。我刚才动了:
net use t: %address%*
到下面一行
::Checks drive availability. Reattempts connection to drive every 5 seconds.
之前
cls