Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-19
5
Medium Priority
?
589 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
[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
  • 3
5 Comments
 
LVL 22

Accepted Solution

by:
Christopher McKay earned 500 total points
ID: 18751369
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
ID: 18751399
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:Christopher McKay
ID: 18751436
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
ID: 18751608
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:Christopher McKay
ID: 18751677
Thanks for the points!

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

Cheers!

:o)

Bartender_1
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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