]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vimtutor): vimtutor throws Access Denied Error on MS-Windows
authorChristian Brabandt <cb@256bit.org>
Mon, 16 Jun 2025 17:48:03 +0000 (19:48 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 16 Jun 2025 17:48:03 +0000 (19:48 +0200)
Problem:  MS-Windows: vimtutor throws Access Denied Error
Solution: switch the order of redirects. First redirect stdout, than
          stderr to stdout, Try to access $TEMP before current directory
          (which is usually c:\Program Files\vim\vim91\ and not writable
          for normal users)

closes: #17550

Signed-off-by: Christian Brabandt <cb@256bit.org>
vimtutor.bat

index 79489f50b836a54d9fa21006e2934af3a3d6729f..cd733844e942eb82437e855e162f8f676d2bf150 100644 (file)
@@ -12,7 +12,7 @@ SetLocal
 :: When that also fails, it uses the English version.
 
 :: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
-for %%G in (. %TMP% %TEMP%) do (
+for %%G in (%TMP% %TEMP% .) do (
   call :TestDirWritable "%~f0" %%G
   if not ERRORLEVEL 1 goto DirOk
 )
@@ -23,7 +23,7 @@ goto End
 
 :TestDirWritable
 set TUTORCOPY=%2\$tutor$
-copy %1 %TUTORCOPY% 2>&1> nul
+copy %1 %TUTORCOPY% >nul 2>&1
 goto DelTmpCopy
 
 :DirOk