diff --git a/src/vs/workbench/api/node/apiCommands.ts b/src/vs/workbench/api/node/apiCommands.ts index 9adcf231889..6be39d21aaa 100644 --- a/src/vs/workbench/api/node/apiCommands.ts +++ b/src/vs/workbench/api/node/apiCommands.ts @@ -49,8 +49,8 @@ export class OpenFolderAPICommand { return executor.executeCommand('_files.pickFolderAndOpen', forceNewWindow); } if (!uri.scheme) { - console.warn('`vscode.openFolder` command invoked with an invalid URI (scheme missing): `${uri}`. Converted to a `file://` URI.'); - uri = URI.file(uri.fsPath); + console.warn(`'vscode.openFolder' command invoked with an invalid URI (scheme missing): '${uri}'. Converted to a 'file://' URI.`); + uri = URI.file(uri.toString()); } return executor.executeCommand('_files.windowOpen', [uri], forceNewWindow);