|
-
Jan 8th, 2023, 12:44 PM
#1
Thread Starter
Addicted Member
What am I doing wrong???
I wrote a simple VB.NET application. When the program, which writes a super-short text file to the desktop, is run from within Visual Studio, it runs just fine. However, when it is run by double-clicking the .exe file, this error appears: Unhanded exception has occurred... Access to the path "desktop" is denied.
I checked explorer and the security in the desktop folder appears to be set correctly. What on earth is wrong?
-
Jan 8th, 2023, 01:18 PM
#2
Re: What am I doing wrong???
Does it work if you right-click the .exe file and choose "Run As Administrator"?
-
Jan 8th, 2023, 06:15 PM
#3
Re: What am I doing wrong???
 Originally Posted by groston
I wrote a simple VB.NET application. When the program, which writes a super-short text file to the desktop, is run from within Visual Studio, it runs just fine. However, when it is run by double-clicking the .exe file, this error appears: Unhanded exception has occurred... Access to the path "desktop" is denied.
I checked explorer and the security in the desktop folder appears to be set correctly. What on earth is wrong?
How are you getting the path to the desktop?
-
Jan 9th, 2023, 12:00 AM
#4
Thread Starter
Addicted Member
Re: What am I doing wrong???
Thanks for the replies.
OptionBase1: Same error
PausiblyDamp: Dim dirPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
-
Jan 9th, 2023, 12:37 AM
#5
Re: What am I doing wrong???
Hi can you try:
Also, it is very hard to figure out your problem with only one line of code you provided. I would suggest you post the whole block...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|