本帖最后由 zisss 于 2017-1-23 12:48 编辑
- @ECHO OFF&& SETLOCAL&& PUSHD "%~dp0"&& SETLOCAL ENABLEDELAYEDEXPANSION&& SETLOCAL ENABLEEXTENSIONS&& SET _V=5&& IF NOT "!_V!"=="5" (Echo DelayedExpansion Failed&& Goto :Eof)
- REM 以上為同一行
-
- Copy "C:\data\txt数合成.Cmd" "C:\adpk01\">nul 2>&1&& Start "" "C:\adpk01\*.Cmd"&& Exit
- REM 建議使用副檔名 .Cmd
-
- @ECHO OFF&& SETLOCAL&& PUSHD "%~dp0"&& SETLOCAL ENABLEDELAYEDEXPANSION&& SETLOCAL ENABLEEXTENSIONS&& SET _V=5&& IF NOT "!_V!"=="5" (Echo DelayedExpansion Failed&& Goto :Eof)&& Copy "C:\data\txt数合成.Cmd" "C:\adpk01\">nul 2>&1&& Start "" "C:\adpk01\*.Cmd"&& Exit
- REM 同行
-
- 您試試!!
- 我習慣不寫死絕對路徑
- if "%SystemDrive%"=="C:" (
- Copy "%SystemDrive%\data\txt数合成.Cmd" "%SystemDrive%\adpk01\">nul 2>&1&& Start "" "%SystemDrive%\adpk01\*.Cmd"&& Exit
- )
-
- 我所有子批次抬頭 給您參考
- @ECHO OFF&& SETLOCAL&& PUSHD "%~dp0"&& SETLOCAL ENABLEDELAYEDEXPANSION&& SETLOCAL ENABLEEXTENSIONS&& SET _V=5&& IF NOT "!_V!"=="5" (Echo DelayedExpansion Failed&& GOTO :EOF)
- SET "_LEE="
- REM :::::::::::::::::::::::::: REM
- REM :: 設定個人 啟動變數 :: REM
- REM :::::::::::::::::::::::::: REM
- If Not Exist "%_LEE%" (
- If Exist "D:\Lee\_START.Cmd" SET "_LEE=D:\Lee"
- If Exist "E:\Lee\_START.Cmd" SET "_LEE=E:\Lee"
- If Exist "F:\Lee\_START.Cmd" SET "_LEE=F:\Lee"
- If Exist "G:\Lee\_START.Cmd" SET "_LEE=G:\Lee"
- If Exist "H:\Lee\_START.Cmd" SET "_LEE=H:\Lee"
- )
- If Not Exist "%_LEE%" @Echo Off&& Cls&& Color 4F&& Echo.&& Echo [啟動變數] : [設定失敗] : Error.. %%_LEE%%&& Echo.&& Pause
- REM :::::::::::::::::::::::::: REM
- REM :: 呼叫設定 環境變數 :: REM
- REM :::::::::::::::::::::::::: REM
- If Exist "%_LEE%" (
- Call "%_LEE%\SET_APP.Cmd"||Echo Off&& Title 發生錯誤&& Color 4F&& Echo.&& Echo [呼叫設定] : Call "%%_LEE%% 顯示 : %_LEE%\SET_APP.Cmd" [發生錯誤] : Error Not Exist&& Echo.&& Pause
- Call "%_LEE%\SET_LOG.Cmd"||Echo Off&& Title 發生錯誤&& Color 4F&& Echo.&& Echo [呼叫設定] : Call "%%_LEE%% 顯示 : %_LEE%\SET_LOG.Cmd" [發生錯誤] : Error Not Exist&& Echo.&& Pause
- Call "%_LEE%\SET_CHO.Cmd"||Echo Off&& Title 發生錯誤&& Color 4F&& Echo.&& Echo [呼叫設定] : Call "%%_LEE%% 顯示 : %_LEE%\SET_CHO.Cmd" [發生錯誤] : Error Not Exist&& Echo.&& Pause
- )
复制代码
|