copy file in cmd

Posted on 2011-10-10
Last Modified: 2012-05-12
 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
Question by:tristonyip
    LVL 4

    Accepted Solution

    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
    LVL 66

    Expert Comment

    "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.


    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....

    Author Closing Comment

    it works, thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    I wanted to pass this along in case anyone has a problem removing a device from the Device Manager, or if you suspect a corrupted Driver that you want to remove in its entirety. I know it is kinda lengthy and very basic in its format, but I figured …
    Most of the time we are in fix when all of sudden our systems behave weirdly.  Such problems cost time and effort... so it's best to take some preventive actions so that we can avoid such issues or overcome such problems more easily. Preventive M…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now