Forum Discussion
irina_lukina
12 years agoSuper Contributor
Hi Ofer,
I've corrected your code a little bit, and it works fine:
var TargetFolder = "C:\\Logs";
var objShell = new ActiveXObject("Shell.Application");
var objFolder = objShell["Namespace"](TargetFolder);
var colItems = objFolder["Items"]();
for (var i = 0; i < colItems["Count"]; i++)
colItems["Item"](i)["InvokeVerbEx"]("Print");
FYI, the CreateObject object in VBScript corresponds to the new ActiveXObject statement in C#Script. Also, there is no need to specify Next at the end of the For statement. I hope this information helps :)
Related Content
- 6 years agocmbdnne
- 8 years agom_essaid
- 5 years agodjvakarjoshi1
Recent Discussions
- 2 hours agoSvetaG