How to get folder path using electron

As @phuongle pointed out in the comments you want to use showOpenDialog(). Something like this:

var remote = require('remote');
var dialog = remote.require('electron').dialog;

var path = dialog.showOpenDialog({
    properties: ['openDirectory']
});

UPDATE: If the above isn’t working for your current Electron version, you should try more modern importing:

const {dialog} = require('electron').remote;

In addition, in order to use remote, you need to set enableRemoteModule when creating your window in your main process:

const myWindow = new BrowserWindow({
    webPreferences: {
        enableRemoteModule: true
    }
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)