Jupyter notebook start up folder

By default jupyter start up folder is set to user profile folder. This guide provide steps is to change Jupyter notebook start up folder. When Jupyter notebook or lab is launched from Anacondas.

Anacondas Distribution (Windows)

1- Launch anacondas navigator
2- Go to environments and select required environment
3- Open terminal as shown in below screenshot

Anacondas Terminal

4- Generate configuration files for jupyter and jupyter-lab using following commands in terminal window
5- Following command is to create configuration file for jupyter notebook

jupyter notebook --generate-config

6- Following command is to create configuration file for jupyter-lab

jupyter-lab --generate-config

7- Configuration path is shown in cmd once configuration file is created as seen below

Config File

8- Go to configuration directory, using path from cmd
9- Update *_config files to add new folder path

Config Location

Jupyter notebook startup folder

1- Open jupyter_notebook_config.py in notepad
2- Find “c.NotebookApp.notebook_dir” in file
3- Remove “#” to uncomment this config entry
4- Add required startup directory path in single quotes as shown below
5- Save and close file
6- Jupyter notebook should now open in updated path

#from
#c.NotebookApp.notebook_dir = ''
#to
c.NotebookApp.notebook_dir = 'D:/path'

Jupyter lab startup folder

1- Open jupyter_lab_config.py in notepad
2- Find “c.ServerApp.notebook_dir” in file
3- Remove “#” to uncomment this config entry
4- Add required startup directory path in single quotes as shown below
5- Save and close file
6- Jupyter lab should now open in updated path

#from
#c.ServerApp.notebook_dir = ''
#to
c.ServerApp.notebook_dir = 'D:/path'

Related Links

List file extension in windows
SQL proxy as windows task
Test sftp connection

List of file extension in a directory

Question

How to get distinct list of file extension in a directory and sub directory in windows?

Option 1: List of file extension

  1. Open notepad and paste “script 1” into this file
  2. Save file with “.bat” extension
  3. Open cmd in the directory that has “.bat” file
  4. Run “script 2” to output distinct list of file extension into “output.txt” file.
  5. Replace “path” in script 2 with actual path you want to traverse
Script 1
@echo off

set target=%~1
if "%target%"=="" set target=%cd%

setlocal EnableDelayedExpansion

set LF=^


rem Previous two line left blank for LF to work

for /f "tokens=*" %%i in ('dir /b /s /a:-d "%target%"') do (
    set ext=%%~xi
    if "!ext!"=="" set ext=FileWithNoExtension
    echo !extlist! | find "!ext!:" > nul
    if not !ERRORLEVEL! == 0 set extlist=!extlist!!ext!:
)

echo %extlist::=!LF!%

endlocal
Script 2
batchfile "path" >output.txt

Option 2:

  1. Create new folder
  2. Open power shell in this folder (shift + right mouse click)
  3. Run following command to output distinct list of file extension in a directory in output.txt file
  4. Replace “\\path” with directory path that you want to traverse
Get-Childitem "\\path" -Recurse | WHERE { -NOT $_.PSIsContainer } | Group Extension -NoElement | Sort Count -Desc > output_ps.txt
output.txt

Other useful link

Windows file extensions
Jupyter start up folder
Highlight Excel rows