Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromonaco committed Jul 19, 2023
1 parent 4219425 commit 04db792
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,21 @@
"source": false
}
}
},
{
"id": "c6e726f8aada69c0",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "How-to/Run a tool globally on Windows.md",
"mode": "source",
"source": false
}
}
}
],
"currentTab": 6
"currentTab": 8
}
],
"direction": "vertical"
Expand Down Expand Up @@ -170,9 +182,9 @@
"state": {
"type": "backlink",
"state": {
"file": "Cloud/AWS/Cognito.md",
"collapseAll": true,
"extraContext": true,
"file": "How-to/Run a tool globally on Windows.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
Expand All @@ -187,7 +199,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Cloud/AWS/Cognito.md",
"file": "How-to/Run a tool globally on Windows.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -210,7 +222,7 @@
"state": {
"type": "outline",
"state": {
"file": "Cloud/AWS/Cognito.md"
"file": "How-to/Run a tool globally on Windows.md"
}
}
},
Expand All @@ -226,7 +238,7 @@
}
],
"direction": "horizontal",
"width": 580.5
"width": 271.5
},
"left-ribbon": {
"hiddenItems": {
Expand All @@ -239,8 +251,10 @@
"webpage-html-export:Export Vault to HTML": false
}
},
"active": "418ab84c808d127b",
"active": "c6e726f8aada69c0",
"lastOpenFiles": [
"Management/Psychological Safety.md",
"How-to/Run a tool globally on Windows.md",
"Cloud/AWS/Moto.md",
"Cloud/AWS/Cognito.md",
"Cloud/AWS/Index.md",
Expand Down Expand Up @@ -269,8 +283,6 @@
"Management/Health Monitor.md",
"Management/High Performing Teams.md",
"Management/Hiring.md",
"Management/Leadership.md",
"Management/Management.md",
"Frontend",
"How-to/Git",
"How-to/Powershell",
Expand Down
23 changes: 23 additions & 0 deletions src/How-to/Run a tool globally on Windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
To add a folder to the `PATH` environment variable:

1. In Windows File Explorer, navigate to the folder containing the EXE.
2. Copy the full path to the folder from the address bar.
3. Open the Start menu, search for "Environment Variables", and select "Edit the system environment variables".
4. Click the "Environment Variables" button.
5. Under "System Variables", scroll down and select "Path", then click "Edit".
6. Click "New", paste the path to the folder containing the EXE, and click "OK" on all open windows.
7. Open a command prompt window and type the name of the EXE. It should run from any folder because the folder is included in the `PATH` environment variable.


The folder must be under `C:\Program Files\local-dev-cli`, then you can run `localdev` (`localdev.exe`) from anywhere

```csharp
//Make the tool accesible globally
string folderPathToAdd = @"C:\Program Files\local-dev-cli";
string pathVariable = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine) ?? "";
if (!pathVariable.Contains(folderPathToAdd))
{
pathVariable = $@"{folderPathToAdd};{pathVariable}";
Environment.SetEnvironmentVariable("Path", pathVariable, EnvironmentVariableTarget.Machine);
}
```

0 comments on commit 04db792

Please sign in to comment.