DOS 选项跳转实现、dos + bcp 双击导入导出数据

来源:互联网
更新时间:2016/12/12 2:47:31
责任编辑:李志喜
字体:

DOS 选项跳转实现、dos + bcp 双击导入导出数据

  • option.bat
  • 点击图片看大图学网 www.xue163.com

@echo off
:Start2 
cls
goto Start
:Start
title Frequently Used Websites
echo Please select a website from the list
echo with the corresponding key
echo --------------------------------------
echo [1] Google
echo [2] Wikipedia
echo [3] Facebook
echo [4] Youtube
echo [5] Yahoo
set input=
set /p input= Choice:
if "%input%" =="" goto N
if %input%==1 goto Z if NOT goto Start2
if %input%==2 goto X if NOT goto Start2
if %input%==3 goto C if NOT goto Start2
if %input%==4 goto V if NOT goto Start2
if %input%==5 goto B if NOT goto Start2
if %input% gtr 5 goto N

:Z
cls
echo You have selected Google
pause
start www.google.com
exit
:X
cls
echo You have selected Wikipedia
pause
start www.wikipedia.com
exit
:C
cls
echo You have selected Facebook
pause
start www.facebook.com
exit
:V
cls
echo You have selected Youtube
pause
start www.youtube.com
exit
:B
cls
echo You have selected Yahoo
pause
start www.Yahoo.com
exit
:N
cls
echo Invalid Selection! Try again
pause
goto :start2

  • Mantis0000225_ExportSalesOrder_Autosys.cmd
  • 点击图片看大图

@cls
@echo OFF
@set "endfix=%date:~,4%-%date:~5,2%-%date:~8,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%"
@SETLOCAL ENABLEEXTENSIONS
@SETLOCAL ENABLEDELAYEDEXPANSION
@echo ...
@echo VALIDATE ENVIRONMENT VARIABLES ...
rem +--------------------------------------------------------------------------+
rem | VALIDATE ENVIRONMENT VARIABLES                                           |
rem +--------------------------------------------------------------------------+

@set MSBACKUP=D:\SalesOrder_NEWDRM
@set MSLOG=D:\SalesOrder_NEWDRM
@set MSTMP=D:\SalesOrder_NEWDRM
@echo ...
@echo DECLARE ALL GLOBAL VARIABLES...
rem +--------------------------------------------------------------------------+
rem | DECLARE ALL GLOBAL VARIABLES.                                            |
rem +--------------------------------------------------------------------------+

@set FILENAME=SALESORDER
@set DB_USERNAME=DRMPOS
@set DB_PASSWORD=DRMPOS
@set TNS_ALIAS=DRMPROD
@set LOGFILE=%MSLOG%\%FILENAME%_%TNS_ALIAS%.log
@set DUMPFILE=%MSBACKUP%\%FILENAME%_%TNS_ALIAS%.dat
rem +--------------------------------------------------------------------------+
rem | WRITE EXPORT PARAMETER FILE.                                             |
rem +--------------------------------------------------------------------------+
@echo ...
@echo MOVE OLD EXPORT (DUMP) FILE....
rem +--------------------------------------------------------------------------+
rem | MOVE OLD EXPORT (DUMP) FILE.                                             |
rem +--------------------------------------------------------------------------+

@if exist "%DUMPFILE%.backup" (del /q "%DUMPFILE%.backup")

@if exist %DUMPFILE% (echo f|@xcopy /y   %DUMPFILE% %DUMPFILE%.backup)
@if exist %LOGFILE% (echo f|xcopy /y  %LOGFILE% "%LOGFILE%.%endfix%")
@if exist "%LOGFILE%.%endfix%" (echo f | xcopy /y  "%LOGFILE%.%endfix%" D:\SalesOrder_NEWDRM\logfile\&del /q "%LOGFILE%.%endfix%")
@if exist %LOGFILE% (del /q %LOGFILE%)
@echo ...
@echo PERFORM EXPORT...
rem +--------------------------------------------------------------------------+
rem | PERFORM EXPORT.                                                          |
rem +--------------------------------------------------------------------------+

rem exp parfile=%PARFILE%
@bcp " select * from drmpos.SALESORDER where orderdate >= convert(DATE,getdate()-10)" queryout %DUMPFILE% -T -c -t^| -d apoms -e %LOGFILE% 
 
@IF not EXIST %LOGFILE% GOTO end

@echo ...error occured
@echo SCAN THE EXPORT LOGFILE FOR ERRORS...
rem +--------------------------------------------------------------------------+
rem | SCAN THE EXPORT LOGFILE FOR ERRORS.                                      |
rem +--------------------------------------------------------------------------+
@echo ...
@echo Analyzing log file for errors...
@findstr /I /C:"Export terminated unsuccessfully" %LOGFILE%
@if errorlevel 1 (goto good1) else (goto exception)
:END
@echo ...
@echo finished WITHOUT errorlog
@exit /b 0
:good1
@echo ...
@echo Analyzing log file for MS-errors...
@findstr /I /C:"invalid" %LOGFILE%
@if errorlevel 1 (goto good2) else (goto exception)

:good2
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"error" %LOGFILE%
@if errorlevel 1 (goto good3) else (goto exception)

:good3
@echo ...
@echo Analyzing log file for warnings...
@findstr /I /C:"rows" %LOGFILE%
@if errorlevel 1 (cmd /c exit 0) else (goto exception)
@exit /b 0

:exception
@exit /b 1
www.xue163.com true /5/55098.html report 5853 DOS选项跳转实现、dos+bcp双击导入导出数据,DOS选项跳转实现、dos+bcp双击导入导出数据option.bat@echooff:Start2clsgotoStart:StarttitleFrequentlyUsedWebsitesechoPleaseselectawebsitefr...
最近关注
首页推荐
热门图片
最新添加资讯
24小时热门资讯
精彩资讯
精彩推荐
热点推荐
真视界
精彩图片
社区精粹
关于本站 | 广告服务 | 手机版 | 商务合作 | 免责申明 | 招聘信息 | 联系我们
Copyright © 2004-2016 Xue163.com All Rights Reserved. 学网 版权所有
京ICP备10044368号-1 京公网安备11010802011102号
荐闻 | 学网头条知识问答 | 装修 | 作业 | 荐闻 | 学网头条精彩微信 | 新闻中心 | 软件教室 | 设计大全 | 网络相关 | 英语学习 | 开发编程 | 考试中心 | 参考范文 | 管理文库 | 营销中心 | 站长之家 | IT信息中心 | 商学院 | 数码大全 | 硬件DIY | 企业服务 | 网吧在线 | 问吧 | 百科 | 硬件知识 | 本网视点 | 文库 | 手机 | 平板 | 汽车 | 游戏 | 家电 | 精彩摄影 | 时尚科技 | 现代家居 | IT女人 | 经验 | 每日新闻 | 健康养生 | 图书馆 | 猎奇 | 精彩看点 | 图库 | 新闻中心 | 软件教室 | 设计大全 | 网络相关 | 英语学习 | 开发编程 | 考试中心 | 参考范文 | 管理文库 | 营销中心 | 站长之家 | IT信息中心 | 商学院 | 数码大全 | 硬件DIY | 企业服务 | 网吧在线 | 问吧 | 百科 | 硬件知识 | 本网视点 | 文库 | 手机 | 平板 | 汽车 | 游戏 | 家电 | 精彩摄影 | 时尚科技 | 现代家居 | IT女人 | 经验 | 每日新闻 | 健康养生 | 图书馆 | 精彩微信 | 猎奇 | 精彩看点 | 图库编程 方案 信息windows方案windows answer文档机构教育文档问答中心IT编程数码信息解决方案信息中心IT科技