运行一直报错:The syntax of the command is incorrect.
哪位可以帮忙看看,谢谢!
------------------------------------------------------------------------------------- @echo off
-
- @hostname>>"c:\temp\hostname.txt"
-
- set /p host=<c:\temp\hostname.txt
-
- if "%host:~7,5% lss 10031 (echo %user% is Com_PRD_PPC01)
- else if "%host:~7,5% lss 10061 (echo %user% is Com_PRD_PPC02)
- else if "%host:~7,5% lss 10091 (echo %user% is Com_PRD_PPC03)
- else if "%host:~7,5% lss 10121 (echo %user% is Com_PRD_PPC04)
- else if "%host:~7,5% lss 10151 (echo %user% is Com_PRD_PPC05)
- else if "%host:~7,5% lss 10181 (echo %user% is Com_PRD_PPC06)
- else if "%host:~7,5% lss 10211 (echo %user% is Com_PRD_PPC07)
- else if "%host:~7,5% lss 10241 (echo %user% is Com_PRD_PPC08)
- else if "%host:~7,5% lss 10271 (echo %user% is Com_PRD_PPC09)
- else if "%host:~7,5% lss 10301 (echo %user% is Com_PRD_PPC10)
- else if "%host:~7,5% lss 10331 (echo %user% is Com_PRD_PPC11)
- else if "%host:~7,5% lss 10361 (echo %user% is Com_PRD_PPC12)
- else if "%host:~7,5% lss 10391 (echo %user% is Com_PRD_PPC13)
- else if "%host:~7,5% lss 10421 (echo %user% is Com_PRD_PPC14)
- else if "%host:~7,5% lss 10451 (echo %user% is Com_PRD_PPC15)
- else if "%host:~7,5% lss 10481 (echo %user% is Com_PRD_PPC16)
- else if "%host:~7,5% lss 10511 (echo %user% is Com_PRD_PPC17)
- else if "%host:~7,5% lss 10541 (echo %user% is Com_PRD_PPC18)
- else if "%host:~7,5% lss 10571 (echo %user% is Com_PRD_PPC19)
- else if "%host:~7,5% lss 10601 (echo %user% is Com_PRD_PPC20)
- else if "%host:~7,5% lss 10631 (echo %user% is Com_PRD_PPC21)
- else if "%host:~7,5% lss 10661 (echo %user% is Com_PRD_PPC22)
- else if "%host:~7,5% lss 10691 (echo %user% is Com_PRD_PPC23)
- else if "%host:~7,5% lss 10721 (echo %user% is Com_PRD_PPC24)
- else if "%host:~7,5% lss 10751 (echo %user% is Com_PRD_PPC25)
- else if "%host:~7,5% lss 10781 (echo %user% is Com_PRD_PPC26)
- else (goto eof)
-
- copy c:\Script\Time\shortcut.lnk "C:\Users\%user%\Desktop\shortcut.lnk"
-
- pause&exit
复制代码
|