Sign in to follow this  
robopp

Getting Desktop Path

Recommended Posts

Is there a way to get the desktop path programatically? The cmd desktop path shortcut - %userprofile%/desktop - doesn't work.

Share this post


Link to post
Share on other sites

Not built in.  I would probably use a trick, probably with a batch file.  The batch file would just have something like:

echo %userprofile%/desktop > c:\data\desktopPath.txt

You'd run it from DAQFactory using shellExecute():

system.shellExecute("cmd.exe","c:\data\myBatchFile.bat")

Then you can simply use the file. functions to read the desktopPath.txt file and get the results.

This is off the cuff, but should work, possibly with minor tweaks.  Test each part.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this