Skip to content

Commit d9438cc

Browse files
authored
doc: fix copy node executable in Windows
Windows where command lists all places it finds a pattern in Path. The first one is the one that executes when called. So the old code was overriding the first executable by any other match. PR-URL: nodejs#48624 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent a1fe0d7 commit d9438cc

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

doc/api/single-executable-applications.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,8 @@ tool, [postject][]:
5858

5959
* On Windows:
6060

61-
Using PowerShell:
62-
63-
```powershell
64-
cp (Get-Command node).Source hello.exe
65-
```
66-
67-
Using Command Prompt:
68-
6961
```text
70-
for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe)
62+
node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')"
7163
```
7264

7365
The `.exe` extension is necessary.

0 commit comments

Comments
 (0)