Skip to main content
Participant
April 9, 2019
Question

Downloads folder path

  • April 9, 2019
  • 1 reply
  • 876 views

Hello,

How could I find the path to the Downloads folder with CSInterface?

This topic has been closed for replies.

1 reply

Trevor:
Legend
April 14, 2019

csInterface doesn't provide help for getting the downloads folder.

One has to note that the "Downloads" folder is not necessarily the folder where downloads get saved.

Each browser / app will have it's own settings.

I think the Downloads folder can be defined as the folder that has the pretty downloads icon.

On Mac I think it's location is ~/Downloads irrespective of the user language.

Not 100% sure about it and it would be nice to hear some feedback on that.

Hi Laubender

On Windows one can read the registry which store the download folder by using exec when nodejs is enabled.

The shell folders entry contains all the handy folders you can check it out with regedit or from cmd do *

Reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"

From your js script you can do

var exec = require('child_process').exec;

var result = function (error,result) {

    alert(result.split(/REG_SZ /)[1]);

}

exec('Reg query "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"  /v "{374DE290-123F-4565-9164-39C4925E467B}"', result)

* based on https://stackoverflow.com/questions/27460275/get-the-windows-download-folders-path-download-shell-folder-in-a-batch-file

HTH

Trevor