Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can't programmatically copy files VB.net to Windows 7 -"Destination Folder Access Denied"

Posted on 2012-03-16
2
Medium Priority
?
2,508 Views
Last Modified: 2012-03-26
Experts - Please help!!

Please let me know how to programmatically (VB.NET 3.5 Framework) How to copy a file within a Windows 7 environment.

I have a WinForms app that runs fine in a Windows XP 32 Bit environment.

It updates a winForms application by programmatically coping files to users machines (via UNC) (i.e. "\\MachineName\C$\Program Files\AppName\AppName.exe").

I have a VB.NET 3.5 Framework in VS2008 and am using "System.IO.File.Copy"

As a reminder - The code still works great for a 32Bit Windows XP machine.

When I run the same code and try to copy to the appropriate folder: \\MachineName\C$\Program Files (x86)\AppName\AppName.exe. It will not copy and gives me the following error:

"Access to the path '"\\MachineName\C$\Program Files\AppName\AppName.exe' is denied."

Please let me know how to copy this. FYI- If I manually copy the files it asks me to confirm that I want to copy the files, and warns me in a popup window
Copy Warning on Windows 7
When I hit "Try Again" it will copy the file.

(On the XP machines it will just copy the file without a warning).

This problem also happens in the regular 64 Bit program file on my (C:\Program Files\AppNameCompilesAs64Bit\AppName.exe).

Again - Please let me know how to programmatically (VB.NET 3.5 Framework) How to copy a file within a Windows 7 environment.
0
Comment
Question by:dantheanswerman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 37730279
0
 
LVL 2

Author Closing Comment

by:dantheanswerman
ID: 37765969
Perfect answer ... I was able to elevate permissions and as long as I run as an administrator, it works perfectly!

Thanks - you made my day.

Dan
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question