1. Add Environment Variable into System
set regpath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
reg add "%regpath%" /v "UAS_TOMCAT_HOME" /d "D:\starcite\uas\tomcat"
2. Rename File with system date and time.
echo %date% %time%
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set MMDDhhmm=%date:~4,2%%date:~7,2%%hh%%time:~3,2%
set logPath=D:\DeployLog\%1-%3-%MMDDhhmm%\
3. Get files list from a certain folder
@echo off
rem --设置指定路径为c:\test
set "pt=c:\test"
rem --获取指定路径下所有文件和文件夹的名称
for /f %%i in ('dir /s/b c:\test') do (
rem --这里做为显示的命令参数
echo %%i
)
4. Get file list.
rem FOR /R %logFilePath% %%i in (%fileList%) DO @echo %%~ni%%~xi>>%logList%
set regpath=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
reg add "%regpath%" /v "UAS_TOMCAT_HOME" /d "D:\starcite\uas\tomcat"
2. Rename File with system date and time.
echo %date% %time%
set hh=%time:~0,2%
if "%time:~0,1%"==" " set hh=0%hh:~1,1%
set MMDDhhmm=%date:~4,2%%date:~7,2%%hh%%time:~3,2%
set logPath=D:\DeployLog\%1-%3-%MMDDhhmm%\
3. Get files list from a certain folder
@echo off
rem --设置指定路径为c:\test
set "pt=c:\test"
rem --获取指定路径下所有文件和文件夹的名称
for /f %%i in ('dir /s/b c:\test') do (
rem --这里做为显示的命令参数
echo %%i
)
4. Get file list.
rem FOR /R %logFilePath% %%i in (%fileList%) DO @echo %%~ni%%~xi>>%logList%