Solved

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

Posted on 2007-03-19
5
577 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:
Christopher McKay earned 125 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

829 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