I am working with Single File /Application and yes, it's Windows Application Forms application /Desktop application.
Copy Files and Folders from CURRENT directory to User Home Folder VB.Net
Hi,
Is it possible to use "Current Directory" as source (instead of full /absolute path) to copy file /folder to current user profile?
Source: C:\myData\Backups\Latest**UserBackup**\SavedData\StdDoc.txt
<Instead of using the whole path, can we limit to the current directory, In my case it's UserBackup where the VB app should run>
Possibility to define source as: CurrentDir\SavedData\StdDoc.txt ?
Destination: %UserName%\Documents\StdDoc.txt
7 answers
Sort by: Most helpful
-
-
Cory Smith 11 Reputation points
2020-12-08T14:53:36.267+00:00 If a single file .NET Framework 4.x WinForms application, it should work. If not .NET Framework 4.x (or prior), then things are a bit more complicated (but can be done).
The suggestion by anonymous user of prompting the user is also a very good option as this provides flexibility in allowing the application to "launch from anywhere". With that said, this suggestion also doesn't really solve the problem as you are still left with two options:
- default to "nothing" and force your end-user to pick before your applications related functionality does anything...
- determine a suitable (most likely relevant) default set of paths.
As an end-user, I like the idea of things "just working" out of the box and, as anonymous user suggests, given the ability to modify these values to suit my particular needs.