No, the actual file itself really needs to be on the desktop. But thanks for the suggestion!
As I ponder this, I'm starting to think that the subst method may actually be best, despite its drawbacks. Having the DP app able to just output to drive Q: to land something on the desktop is really handy. Plus, if the app gets run on a 64 bit machine using VDos, I can configure VDos to also have a Q: drive pointing to the user's desktop. Or if later another destination is preferred then Q: can be remapped in the batch file or VDos without having to change anything in the DP app. Since this is an in-house app used by only 4 user's (and I'm the IT guy), I can ensure that drive Q: remains available for my purposes. I was actually posing the question more as a way to get ideas of how to get DP to output to user-specific folder(s) in a reliable and fairly bullet-proof manner, in case I (or anyone else here) needed to do so for a distributed app. On April 25, 2017 12:38:53 AM CDT, Bob DeRosier <[email protected]> wrote: Does it make sense to put a shortcut on the desktop and have the short cut point to the network location ? You will need to work a small bit to distribute the shortcut. On 4/24/2017 8:51 PM, Tim Rude wrote: Yeah, I could do that, but I really want the destination to be the user's desktop. There's just one file that gets dropped there (but the content changes each time) and it needs to be on the desktop for ready access. So far both of the approaches I described have worked, but neither is perfect, yet. On April 24, 2017 9:14:16 PM CDT, Don Friedman <[email protected]><mailto:[email protected]> wrote: You lost me here, Tim. Over my pay grade. Couldn't you set up a network location to save the text files that would be common? Don Friedman ProfessionalRecords.Com LLC PRS Data Systems 205 S Main Street Pittsburgh, PA 15215 1-800-PRS-FILE 412-784-1615 Fax 412-400-3881 Cell/Text On Mon, Apr 24, 2017 at 5:50 PM, Tim Rude <[email protected]<mailto:[email protected]>> wrote: I need DP to be able to create a text file on the user's desktop. Sounds simple enough, but the folder that actually appears as the desktop is different for every user. For user TRR, the folder (on Win7) is C:\Users\TRR\Desktop, but for user JoeBob the folder is C:\Users\JoeBob\Desktop. I didn't see any way inside of DP to determine the correct folder, and DP doesn't translate environment variables (so asking DP to output to %USERPROFILE%\Desktop doesn't work). I'm presently using the /SID=sessionID command line with DP. I always the start the database from a batch file, so I made the command-line in the batch file this: DP.EXE database.str /SID=%USERPROFILE% Now inside my DP reports, I can access the passed SID value as user.field[0]. This is valid even if the database has no UserID panel defined. So, to output a text file on the user's desktop, I configure the report to initially output to C:\NUL. Then at the very beginning of the report I have the following: ---FIRST PAGE HEADER--- ---Store Value in Report Variable 250 --- cat.t[user.field[0];"\Desktop\output.txt"] ---Turn File Off--- ---Begin Writing to Filename in Report Variable 250 --- ---Turn File On--- This works fine as long as all parts of the desktop path fit the 8.3 specs. But for XP there are spaces in the %USERPROFILE% so it's a no-go for XP. And if a username had spaces in it (is that allowed?) or was longer than 8 chars, it won't work under any OS. Anybody know a quick way to (inside a batch file) convert a long path to a short (8.3) one? One other idea that I've floated around is to include this in the batch file: subst /d Q: > nul subst Q: "%userprofile%/Desktop" DP.EXE database.str subst /d Q: > nul Then in my DP reports, I simply output to Q:\output.txt. That seems to get around the 8.3 issues for DP nicely, but is a bit messier since its effects aren't contained to the database (i.e. the user sees a drive Q: in My Computer while the database is running, and what happens if the user already has Q: mapped to something...). One other thing of note is that the database does not run under Shell, so no shell/macro-based solutions are viable. Any better suggestions or ideas? Tim Rude _______________________________________________ Dataperf mailing list [email protected]<mailto:[email protected]> http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf _______________________________________________ Dataperf mailing list [email protected]<mailto:[email protected]> http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=icon> Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=link>
_______________________________________________ Dataperf mailing list [email protected] http://lists.dataperfect.nl/cgi-bin/mailman/listinfo/dataperf
