Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaakif/86554 to your computer and use it in GitHub Desktop.
Save masaakif/86554 to your computer and use it in GitHub Desktop.
var shell = new ActiveXObject("WScript.Shell");
var driveLetter = FolderView.Path.substr(0,1).toLowerCase();
var cmdline = 'cmd.exe /k';
if (driveLetter == "c") {
cmdline += ' "cd ' + FolderView.Path + '"';
}
else {
cmdline += ' "cd ' + FolderView.Path + ' && ' + driveLetter + ':"';
}
shell.Run(cmdline, 1, false);
// shell.Run('cmd.exe /k "cd ' + FolderView.Path + '"', 1, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment