Sorry Everybody, This post is in the wrong place. I reposted it as a new thread on its own, but I am not able to delete it.
Good day everybody,
This is Visual Studio 2020, Windows 10 and VB.Net
I do not know if it can be done.
I am trying to do the following: -
I have a Button named btnCopy on a form. My intention is to find a file from the Installation CD where the Setup or Installation File is, and copy it to the Folder where the program is going to be installed. The reason behind this is in order for all users who are going to use the program to be able to open the file when another button btnShow is clicked.
Below is my codes: -
Code to Copy the file From the CD to the Installation Folder with btnCopy
My.Computer.FileSystem.CopyFile(
"D:\Text1.pdf",
"C:\Users\Kobus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Name\Text1.pdf",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
Code to Open and Show the file with btnShow
Private Sub btnShow_Click(sender As Object, e As EventArgs) Handles btnShow.Click
System.Diagnostics.Process.Start("C:\Users\User Name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Name\Text1.pdf")
End Sub
The challenge is that all users might not have the CD Drives as D:\. Some users might have something else.
I am also not sure whether my coding is correct for the buttons btnCopy and btnShow
Good day everybody,
This is Visual Studio 2020, Windows 10 and VB.Net
I do not know if it can be done.
I am trying to do the following: -
I have a Button named btnCopy on a form. My intention is to find a file from the Installation CD where the Setup or Installation File is, and copy it to the Folder where the program is going to be installed. The reason behind this is in order for all users who are going to use the program to be able to open the file when another button btnShow is clicked.
Below is my codes: -
Code to Copy the file From the CD to the Installation Folder with btnCopy
My.Computer.FileSystem.CopyFile(
"D:\Text1.pdf",
"C:\Users\Kobus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Name\Text1.pdf",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
Code to Open and Show the file with btnShow
Private Sub btnShow_Click(sender As Object, e As EventArgs) Handles btnShow.Click
System.Diagnostics.Process.Start("C:\Users\User Name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\My Name\Text1.pdf")
End Sub
The challenge is that all users might not have the CD Drives as D:\. Some users might have something else.
I am also not sure whether my coding is correct for the buttons btnCopy and btnShow