Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc366794

Browse files
committed
Elevation method previously used in internal tests no longer works. Adding our own elevation script to replace it. (changeset 1344811)
1 parentc57dec8 commitc366794

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// simple elevation script - runs the specified command line as admin
2+
// usage: fsi --exec elevate.fsx <program> [args]
3+
4+
openSystem
5+
openSystem.Diagnostics
6+
7+
letprogram= fsi.CommandLineArgs.[1]
8+
letargs= fsi.CommandLineArgs|> Seq.skip2|> String.concat""
9+
letstartInfo= ProcessStartInfo(FileName= program, Arguments= args, Verb="runas")
10+
letproc=new Process(StartInfo= startInfo)
11+
12+
printfn"Elevating:%s%s" program args
13+
try
14+
proc.Start()|> ignore
15+
if proc.WaitForExit(30*60*1000)then
16+
Environment.Exit(proc.ExitCode)
17+
with e-> eprintfn"%s"(e.ToString())
18+
Environment.Exit(1)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp