2013-09-03 4 views
2

수정되지 않은 파일을 실행 취소하는 tfpt 명령을 실행하려면 빠른 linqpad 스크립트를 만들고 싶었습니다.Linqpad를 사용하여 경로 및 확인이 포함 된 명령을 실행하는 방법

구문은 다음과 같이이다 :

"C :. \ MyProject를>있어서 tftp UU/noget/재귀"

  • 그래서 처음에는 C의 경로를 변경해야합니다 : \ MyProject를합니다.
  • 두 번째로 "tfpt uu./noget/recursive"명령을 실행해야합니다.
  • 마지막으로 실행 취소를 확인해야합니다.

linqpad의 Util.Cmd로이 작업을 수행 할 수 있습니까?

답변

0

예! 베타 버전 http://www.linqpad.net/Beta.aspx의 최신 비트로 lprun.exe라는 유틸리티를 얻을 수 있습니다.

Usage: lprun [<options>] <scriptfile> [<script-args>] 

options: (all case-insensitive) 
-format={text|html|htmlfrag|csv|csvi} Output format. csvi=invariant CSV. 
-cxname=<connection-name>    Sets/overrides a script's connection. 
-lang=<language>      Sets/overrides a script's language. 
-warn         Writes compiler warnings (to stderr). 
-optimize        Enables compiler optimizations. 
-nunuget        Freshens NuGet references to latest. 

scriptfile: Path to script. If it's a .linq file, -lang & -cxname are optional. 

script-args: Args following <script-filepath> are passed to the script itself. 

Examples: 
    lprun TestScript.linq 
    lprun TestScript.linq > results.txt 
    lprun script1.linq | lprun script2.linq 
    lprun -format=csv script.linq HelloWorld 

분명히 당신이 당신의 선택의 언어에서 적절한 LINQPad 스크립트를 작성해야하고, 예, Util.Cmd는()

+0

고마워, 나는 당신이 콘솔을 통해 linqpad 스크립트를 실행할 수 있다고 생각합니다. 하지만 linqpad를 통해 콘솔 스크립트를 실행하고 싶습니다. 먼저, 경로를 설정 한 다음 명령을 확인해야합니다. – 4imble

2

HTH를 갈 수있는 방법입니다 : 구문은 straighforward입니다 그것을 그렇게 관리 할 수 ​​있습니다 (하나의 라이너로 만들었습니다).

Util.Cmd("echo y |tfpt uu C:\\myProject /noget /recursive");