[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

copy file in cmd

hi
 i have a run.cmd file just like that below, but i got access is denied message when i run it. but if i first use Start Menu --> Run --> \\workstationID\c$ and then run the cmd file, it works without access denied message, any idea, and how can i make it work without use the run menu first.



NET USER workstationID\admin password
copy \\sever\Shared\test.txt \\workstationID\c$\testFolder
0
tristonyip
Asked:
tristonyip
1 Solution
 
bloodygonzoCommented:
You may want to map \\workstationID\c$\testFolder as a drive so the batch file would look like this:

net use x: \\workstationID\c$\testFolder /USER:workstationID\admin password

copy \\sever\Shared\test.txt x:\

net use x: /delete
0
 
johnb6767Commented:
"NET USER workstationID\admin password
copy \\sever\Shared\test.txt \\workstationID\c$\testFolder"

Whats the intention of 'net user' here?

net user allows you to mane User Accounts.

Example...

net user John Password /add

Adds the user John, with the password of "Password".

Bloody gonzo is on the money with the proper syntax, I am just trying to make sure we are not missing what your script is really doing....
0
 
tristonyipAuthor Commented:
it works, thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now