Access denied to the path While writing a file in windows 7 using vb.net windows application - vb.net

I am having a windows application. That downloads files from server and write into the local directory. It works fine. When we try the same appliication in Windows 7. IT shows an error Access to the path denied (While writing to the local directory). Any one please help...

It could be UAC issue. Try to start the program as Administrator.
just FYI, to start the program as Administrator: right-click on the program -> click on 'Run as Administrator'
You may also see this: http://technet.microsoft.com/en-us/library/cc709691(WS.10).aspx
to set us your UAC for your system.

Related

Visual Studio installer extension output

I am using Microsoft Visual Studio Installer Projects to make a setup file for my C# app and when I install my app it says:
Failed to update database because the database is read-only
Here is screenshot of my database in Microsoft SQL Management Studio that shows read-only is false.
Here is screenshot of my database file in installer that shows read-only is false.
Yet after installing my app I get error above.
Any idea?
Solved
While comments above were helpful but easiest solution for me that didn't require lots of editing and coding was to change Application Folder path to outside of Program Files (86) folder something like this
C:\[Manufacturer]\[ProductName]
Here is screenshot of where to change that path and everything works fine now
Now it will install on path like C:\My_Company\App_Name where there is no permission restrict for system to access database file.

regsvr32 msinet.ocx Error

(Trying to solve my ultimate goal- Connecting to FTP from Excel to automate file sharing (VBA Beginner))
I'm trying to add Microsoft Internet Transfer Control but it doesn't show up in Excel VBA when I go to Tools>Reference so I followed this site.
msinet.ocx was not in my system32 or SysWOW64 folder so I think I'm supposed to install it at command line so I initially tried running regsvr32 msinet.ocx at C:\Windows\System32 and C:\Windows\SysWOW64 and I get the same error for both: "The module msinet.ocx failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .dll files. The specified module could not be found."
Then I tried running cmd.exe as an administrator and trying it again in both System32 and SysWOW64 and I still get the same error popup. I don't know what to try now. Do I need to do a System Restore? And is that a safe thing to do on my work laptop?
P.S. I'm on Windows 7 Enterprise 64 bit
You properbly need to run the CMD as administrator to get your regsrv32 to work.
I had the same problem in windows 2012 server and it only works when you run the CMD as administrator and then type the regsrv32 "C:\Windows\sysWoW64\msinet.ocx"
I got it finally through this link - https://social.technet.microsoft.com/Forums/windows/en-US/ee5696aa-c94d-481a-bbbe-4dad30ccae7f/vista-error-message-msinetocx-not-correctly-registeredfile-is-missing-or-invalid?forum=itprovistaact
Using Peter's and BVBravo's posts

Cannot access file run on windows startup

I have develop application that start at Windows start up. when I launch application by double clicking, it works fine. When run on windows start up, the application launch well but it cannot access any other files placed on application directory. I got that error 'The system cannot find the file specified'
my code:
Process.Start("file_name")
I used this registry key to start up:
HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
.Net 3.0, Windows 7
What could be the problem ? and please suggest a solution.
thank you.
After Replace,
Process.Start("file_name")
with
Process.Start(My.Application.Info.DirectoryPath & "\file_name")
Works fine.

Unable to start debugging - Visual Studio 2012

"Unable to start debugging 'C:\Windows\System32\WWAHost.exe'. The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging."
Searched for similar posts, but didn't found one. If duplicate just inform.
I am not trying to connect to any remote machine. Just testing on my local machine.
Is there any way to solve this issue. (I'm using Windows 8 Enterprise 64-bit, just a javascript project)
Problem solved. Installed Remote tools update from here and working fine. Thanks for responding. Closing the topic.
I had the same problem. I fixed it by changing properties/compile/target platform to x86 instead of Any CPU. It solved the problem in my case. Hope it helps.
This happened to me just now when I had a website set up in IIS for mydomain.com, and set my project's start up url (Local IIS) to mydomain.com, and then launched the project before remembering to add a record in the host files for the domain:
127.0.0.1 mydomain.com
This got me for a good hour before I remembered I never set the record. Adding the record fixed it right away.
Windows 7 x64, VS 2012
In my case, the Remote Debugging Monitor component was installed and the app was clearly configured to debug locally in settings. This was a WinForms app upgraded from VS 2008, .NET 3.5.
Turns out it was the Windows Firewall. By directly running:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe
A firewall dialog appeared where I could allow msvsmon.exe to run. After a VS 2012 re-start, debugging (locally) was fine!
Ensure you have Local Machine selected in this drop-down menu:
Windows 7 x64, VS 2012, VB.NET
I fixed it like this:-
Create a shortcut on your desktop to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe".
Right-click shortcut and select "Properties" from the dropdown menu. Select the "Compatibity" tab, tick "Run this program as administrator" and click OK
Create a shortcut on your desktop to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe".
Right-click shortcut and select "Properties" from the dropdown menu. Select the "Compatibity" tab, tick "Run this program as administrator" and click OK.
To start VS2012:-
Double-click the msvsmon shortcut icon (that you created above, to launch msvsmon). Wait for the "Visual Studio Remote Debugging Monitor (Administrator)" window to display before continuing ...
Double-click the "Visual Studio 2012 Professional" shortcut icon (that you created above, to launch VS2012)
In VS2012, ensure standard toolbar is visible.
In VS2012, ensure "Solution Platforms" dropdown (on standard toolbar) is visible and set to "x86".
and debug now works (for me anyway) ...
However after 15 minutes or so, debug may stop working and you may get the msvsmon error again. If that happens, simply close VS2012 and msvsmon and then start again (from "To start VS2012:-" above) ...
Myself and several other developers have been trying to look for a solution for this problem for about 3/4 hours as Visual Studio crashed then this error would occur (twice in 2 days). I then suddenly (after a lot of debugging and trying other suggestions and headbanging) I somehow realised that the file which was highlighted had changed and when I was trying to debug was not the MVC app project, once I changed it to my project's one it then worked.
Hope this helps and saves people from hours of pain!
I also got this error, I usually run sites under a named user (which is also a database user) and forgot to set the Application Pool. (parliament's answer also helped me)
For me this worked in VS2013:
Save your work, close Visual Studio then reopen your project
I encountered this error as well.
The cause of mine was that I had accidentally emptied out the following property
Properties->Debugging->WorkingDirectory
Changing it to:
inherit from parent or project defaults
Solved the issue.
If you are using Microsoft's Azure, try attaching manually the debugger:
I have outlined the steps in the following answer:
https://stackoverflow.com/a/35738995/1057052

VB.net and running an external .exe program in both Administrator mode and compatibility mode (windows xp sp2)

Hey all i am trying to find some code that would allow me to run a program with administrator rights and also windows xp sp2 compatibility mode. But i have not yet found any code to do that using VB.net
Any help/links would be great! Thanks!
David
If you don't have to pass command line params, you can create a shortcut to the exe, and set it to compatibility mode and admin there. Then just ShellExecute the shortcut.