Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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