Solved

copy a file to a remote machine, 'net use'

Posted on 2007-03-19
5
571 Views
Last Modified: 2010-05-18
hey guys,

I have a server with a 'pub' folder, shared to everyone with read access. I want to deploy (push) a local file to the pub folder using a batch file for easy deployment. I have administrator rights on the server, but am not on the same workgroup, so I'll need to authenticate.

I can do this :

net use \\myserver\c$ mypass /user:myserver\administrator
copy c:\myfile.exe \\myserver\c$\pub

this does what I want, however, can't do the following which I'd prefer to use :

net use \\myserver\pub mypass /user:myserver\administrator
copy c:\myfile.exe \\myserver\pub

latter one gives an access denied error.
0
Comment
Question by:osafak
  • 3
5 Comments
 
LVL 22

Accepted Solution

by:
Bartender_1 earned 125 total points
Comment Utility
This is because the share is what you're accessing, and it states that everyone has read only access only.

If you want the second command to work, then you need to add write permission for your username to the share.

Hope this helps!

:o)

Bartender_1
0
 
LVL 3

Expert Comment

by:jhoop2002
Comment Utility
you also need to check the NTFS permissions.  When sharing files and folders within windows you have to check both the NTFS and Share permissions.  Bartender_1 was correct in stating that your account will need the write permission, you just need to make sure that its for both the share and NTFS.
0
 
LVL 22

Expert Comment

by:Bartender_1
Comment Utility
thanks for the clarification jhoop2002, although, the fact that they can access and write to the file using the C$ share, but not the pub share, would indicate to me that they do have NTFS permissions to that folder.

:o)

Bartender_1
0
 
LVL 1

Author Comment

by:osafak
Comment Utility
ah, thanks guys, how could I overlook this =) yes it was the share permissions. I usually give full control for everyone to the share, and let ntfs permissions to handle it, did the same and it's ok now =)
0
 
LVL 22

Expert Comment

by:Bartender_1
Comment Utility
Thanks for the points!

I'm glad I was able to be of assistance.

Cheers!

:o)

Bartender_1
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now