Interactive PowerBasic Forum

Legacy Software (PBWIN 9.0+/PBCC 5.0+) => Source Code => Scripting => Windows Script Host => Topic started by: José Roca on July 14, 2008, 07:05:59 AM

Title: IWshShell3.CurrentDirectory Property
Post by: José Roca on July 14, 2008, 07:05:59 AM


The following code displays the current active directory.

JScript


var WshShell = WScript.CreateObject ("WScript.Shell");
WScript.Echo (WshShell.CurrentDirectory);


VBScript


Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo WshShell.CurrentDirectory


PowerBASIC


DIM pWsh AS IWshShell3
pWsh3 = NEWCOM "WScript.Shell"
PRINT ACODE$(pWsh3.CurrentDirectory)