Thanks to visit codestin.com
Credit goes to github.com

Skip to content

change workdir in winpython.ini #986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dearfad opened this issue May 28, 2021 · 4 comments
Open

change workdir in winpython.ini #986

dearfad opened this issue May 28, 2021 · 4 comments
Labels
Procedure Procedure

Comments

@dearfad
Copy link

dearfad commented May 28, 2021

.settings/winpython.ini
WINPYWORKDIR

.scripts/winipython_notebook.bat
@echo off
call "%~dp0env_for_icons.bat" %*
cd/D "%WINPYWORKDIR1%"
"%WINPYDIR%\scripts\jupyter-notebook.exe" %*

cd/D "%WINPYWORKDIR1%" should be "%WINPYWORKDIR%", rignt ?

Winpython64-3.9.2.0 and Winpython64-3.9.4.0

@stonebig
Copy link
Contributor

stonebig commented May 28, 2021

hum,

it's about going to the directory of a file if you dump a file over the icon.

see in env_for_icons.bat

rem default is as before: Winpython ..\Notebooks
set WINPYWORKDIR1=%WINPYWORKDIR%

rem if we have a file or directory in %1 parameter, we use that directory 
if not "%~1"=="" (
   if exist "%~1" (
      if exist "%~1\" (
         rem echo it is a directory %~1
	     set WINPYWORKDIR1=%~1
	  ) else (
	  rem echo  it is a file %~1, so we take the directory %~dp1
	  set WINPYWORKDIR1=%~dp1
	  )
   )
) else (
rem if it it launched from another directory , we keep it that one echo %CD%
if not "%CD%\"=="%~dp0" set  WINPYWORKDIR1=%CD%
)

if it doesn't fit you, you can keep using "%WINPYWORKDIR%"

@dearfad
Copy link
Author

dearfad commented May 31, 2021

I use E:\Github\WPy64-3940\Jupyter Notebook.exe , and change settings/winpython.ini , but failed launching from other directory, is it not the right way to work in other directory?
#WINPYWORKDIR = %HOMEDRIVE%%HOMEPATH%\Documents\WinPython%WINPYVER%\Notebooks
WINPYWORKDIR = E:\Github\Repositories

@ittegrat
Copy link

ittegrat commented Jun 8, 2021

I think the problem is that the WINPYWORKDIR1 is assigned in env_for_icons.bat before evaluating the content of winpython.ini.
I moved the block FOR /F "delims=" %%i IN ... in env_for_icons.bat before the assignement and it works for me.

@stonebig stonebig added the Procedure Procedure label May 4, 2025
@stonebig
Copy link
Contributor

stonebig commented May 4, 2025

was the problem solved ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Procedure Procedure
Projects
None yet
Development

No branches or pull requests

3 participants