`
morgan-java
  • 浏览: 55032 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

DOS Script Example

阅读更多
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%
分享到:
评论

相关推荐

    绿色版PocketDOS 和 绿色版TC3.0

    CPASDEMO C - C example module for the Turbo Pascal - Turbo C++ interface demonstration CPASDEMO PAS - Pascal program that demonstrates Turbo Pascal - Turbo C++ interface CTOPAS CFG - Config file ...

    au3反编译源码

    myAut2Exe - The Open Source AutoIT Script Decompiler 2.9 ======================================================== *New* full support for AutoIT v3.2.6++ :) ... mmh here's what I merely missed in ...

    Shell.Scripting.Recipes.2nd.Edition.A.Problem-Solution.Approach.148420221X

    Each real-world example recipe follows the same structure and easily shows you what's going on in each case. File conversion (DOS, UNIX, and Mac), system administration, and resource monitoring are ...

    Algorithms_and_Data_Structures_in_C++

    Postscript 52 Procedure recursive 45 Q Quadratic formula 48 Quicksort 150 median of three 152 R Rectangular mesh topology of a 76 Recurrence relation 46 Recursion 45 tower of...

    Turbo C++ 3.0[DISK]

    For example, if you will be installing from drive A:, type: A: INSTALL - This INSTALL handles the installation of both the compiler and tools in one operation, and allows several new ...

    Turbo C++ 3.00[DISK]

    For example, if you will be installing from drive A:, type: A: INSTALL - This INSTALL handles the installation of both the compiler and tools in one operation, and allows several new ...

    Utilities for Windows NT 源码

    Included is a short demo program, which may be useful on its own (type 'pushkeys' on the command line for usage instructions and a short example), as well as the original VB program which includes the...

    Object- Oriented Programming with Ansi-C

    system containing a single shell script to create all the sources arranged by chapter. There is a ReadMe file — consult it before you say make. It is also quite instructive to use a program like diff...

    UE(官方下载)

    Execute DOS or Windows commands in UltraEdit or UEStudio Temporary Files UltraEdit and UEStudio use temporary files... but what are temporary files? This power tip provides an explanation as well as ...

    2009 达内Unix学习笔记

    cd 进入某目录,DOS内部命令 显示或改变当前目录。 cd回车/cd ~ 都是回到自己的主目录。 cd . 当前目录(空格再加一个点)。 cd .. 回到上一级目录(空格再加两个点)。 cd ../.. 向上两级。 cd /user/s0807 从绝对...

    i-vector的工具箱

    Assuming that the MCR is installed, a Matlab code can be compiled from either the command window or a DOS/bash terminal as: mcc -m -R -singleCompThread -R -nodisplay -R -nojvm foo.m -I libs/ -o foo ...

    Tcl_TK编程权威指南pdf

    Tcl解释器已经从Unix平台移植到了DOS、Windows、OS/2、NT以及Macintosh环境中,而TK工具包也从X window系统移植到了Windows和Macintosh环境中。 1988年,当我在Berkeley做ousterhout教授的博士生时,第一次听说了...

    Bochs - The cross platform IA-32 (x86) emulator

    - Changed default CPU configuration (generated by configure script with default options) to BX_CPU_LEVEL=6 with SSE2 enabled. - CPU - Implemented PCLMULQDQ AES instruction - Implemented X2APIC ...

    DebuggingWithGDB 6.8-2008

    Table of Contents Summary of gdb . . . . . . . . ....Free Software ....Free Software Needs Free Documentation ....Contributors to gdb....1 A Sample gdb Session ....2 Getting In and Out of gdb ....2.1 Invoking gdb ....

Global site tag (gtag.js) - Google Analytics