Skip to content

Instantly share code, notes, and snippets.

@aktowns
Last active December 23, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aktowns/6610057 to your computer and use it in GitHub Desktop.
Save aktowns/6610057 to your computer and use it in GitHub Desktop.
open System
open System.IO
[<EntryPoint>]
let main argv =
let file = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/envpath.txt"
if File.Exists(file) then
let contents = File.ReadAllText(file)
let currentEnv = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.User)
Environment.SetEnvironmentVariable("PATH", contents + ":" + currentEnv, EnvironmentVariableTarget.User)
0
else -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment