Solved

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

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

752 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