On Wednesday, May 13, 2020 at 7:31:09 PM UTC-4, Thomas Passin wrote: > > Thanks, very cool! These expansion thingies are new to me. I used to use > 4dos and 4nt, but haven't done anything at all tricky with batch files > for ages. > > On Wednesday, May 13, 2020 at 11:18:07 AM UTC-4, Matt Wilkie wrote: >> >> I did have to edit the batch file paths from f:\ to e:\ because the >>> mount name of the drive was different on the two computers. I haven't come >>> up with a way to adapt to the change in drive letter except by editing the >>> batch file, sorry to say. >> >> >> If using CMD (as opposed to Powershell) use %~dp0 >> > [snip]
With this cmd-specific technique, the script to launch Python from the USB stick becomes: @echo off setlocal : Find effective drive for this file. set ed=%~d0 path %ed%\python3\Scripts;%ed%\python3;%PATH% set PYTHONUSERBASE=%ed%\user\python set HOME=%ed%\user\python call python %* endlocal -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/e8793fe3-9b9b-4826-a0f6-ff25453101a4%40googlegroups.com.
