Solved

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

Posted on 2007-03-19
5
576 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SBS 2011 Backup Drive 8 30
deduplication > shared folder size weirdness? 1 44
PerfMon Report Time Out 6 26
VMware ESXi vswitch - performance question 2 46
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

777 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