Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing a file to the desktop
Message
From
10/11/2014 00:07:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01610493
Message ID:
01610798
Views:
83
Sorry I took so long getting back. There were some user issues, and other things to distract me for a while.

I chose to work with the approach offered below because I wasn't familiar with WScript.Shell (although both suggested approaches look clean). In any case, this solution worked like a charm.

With only a folder name, and the third line below for me to add, everything was done.
cUprof = GETENV("USERPROFILE")
cDesktopFolder = ADDBS(m.cUprof) + "Desktop\MyFolderName"
MkDir (cDesktopFolder)

I do have my own wrapper around MkDir though, in case there's already a folder there by that name.

Thanks
Bob


>>I can create a folder programatically from VFP as C:\stuff, but I want to create it on the Windows desktop, and create files from VFP and put them into that folder that's on the desktop. What's the right way to reference the desktop so that I can do this?
>>
>>Bob
>
>It can be referenced as a regular folder, i.e.
>C:\Users\yourUsername\Desktop
>or better yet
>
>cUprof = GETENV("USERPROFILE")
>cDesktopFolder = ADDBS(m.cUprof) + "Desktop"
>
Previous
Reply
Map
View

Click here to load this message in the networking platform