Copy log files to selected USB stick


Recommended Posts

My application writes a log file in a predefined directory. Filename is just date.txt. So for every day a new file is written with log data.

The user can not switch to Windows Explorer to copy these files.
I would like to have a popup where the user can select the inserted USB drive and just press copy or move, so the log files can be transferred to the USB.
There should be no option to explore other area's on the hard disk of the computer, just select an output drive.

Any idea's how to do this?


Link to comment
Share on other sites

Normally you could use file.filesaveDialog(), but that would allow one to view the entire harddrive.  Really you are going to have to simply ask them directly what the drive letter is as DAQFactory doesn't have a way to just browse folders.  There is a FolderSelectDialog() function in the next release which should do the job.  Email us if you'd like to try a pre-release.

Once you have the source and destination you can just use file.copy().

Link to comment
Share on other sites

Thanks for your reply.

For now I made a small utility which is loaded with a ShellExecute() command by button press on the screen.
I can add the log file "source' directory as a parameter in the ShellExecute() command line, so I can use it for different projects.

The file list box will show all available log files and the number of files found.
After pressing the refresh button, it will show all available USB drives and enable the copy and remove button.
Simple but does what I need it to do... copy all log files to a selected USB drive.


DAQView Copy Log.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.