Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difference between wcript.shell and shell.application?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01291861
Message ID:
01291895
Views:
9
See How do I get the path of special folders from Windows FAQ #16022 for Shell.Application availability.

The WSH is included in Windows 2000 and later but it could be removed by some companies because they condiser it a security risk.

>We have code in our system in two places. Both sets of code are trying to determine the correct path to My Documents. Both seem to work.
>
>Code Set 1:
>
>oShell = createobject("wscript.shell")
>m.cPath = oShell.SpecialFolders("MYDOCUMENTS")
>
>
>Code Set 2:
>
>oShell = createobject("Shell.Application")
>oFolder = oShell.NameSpace(0x5)
>m.cPath = oFolder.Self.Path
>
>
>Aside from the obvious extra line of code in Code Set 2, is there a "better" choice between the two. What is the difference between wscript.shell and shell.application. Will both methods work on a Win98 machine?
>
>Thanks for your help.
>
>Rodd
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform