Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > C#.NET > Auto get input in batch script.
【标  题】:Auto get input in batch script.
【关键字】:Auto,get,input,in,batch,script.
【来  源】:http://fengzhimei.cnblogs.com/archive/2005/06/22/179130.html

Auto get input in batch script.

Your Ad Here

    One day, I need to write a batch script to help me with my work, and there are some interactive yes/no prompt, just like this:

    "Do you want to continue?[Y/N]"

    This need to user make a choice, so I had to manually press the keyboard in order to the batch file to continue. but I would like the script can run continuously without any interference. How can I do this?
    Ok, actually you can get user input from a extra file, just do it as following steps:

    1. click Start, click Run, type "notepad" in the open box, this will open notepad with a new text file
    2. type "Y" in the window
    3. save the file(eg.input.txt) in the same folder as your bat file

    Then you can run your batch script in the command-line like this:
    

batchfile.gif


    Cool, isn't it

Using Explorer to get files in the GAC:【上一篇】
Backup or Restore SQL Server Database to another server.:【下一篇】
【相关文章】
  • Using Explorer to get files in the GAC
  • "401: Access Denied" when you call webservice in your webpart.
  • Order of Events in WebPart
  • Reset VSS Admin Password
  • Thinstall 包装 Dotnet 程序分析
  • VC2005中依然没有Refactoring和Code Expansion.
  • System.String是不可变的字符串吗?
  • [电子书下载]Dissecting a C# Application: Inside SharpDevelop
  • String
  • 案例面试真题14: case interview
  • 【随机文章】
  • Linux 线程实现机制分析(转载)
  • Cygwin试用心得
  • CREATE OR REPLACE TRIGGER
  • Internet Sockets 网络编程指南(二)
  • HCNE试题及答案4
  • 学习一下 .net framework 中有关安全的内容(续)
  • 我的emacs配置文件
  • 关注WebWork(三)
  • Winform DataGrid设计三步曲之二------如何在DataGrid中加入ComboBox控件
  • css缩写的主要规则
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.