Copy Files to Sharepoint

Posted on 2012-08-28
Last Modified: 2012-09-10

I have been using a batch file with the following line to copy local files to Sharepoint document library :

copy \\servername\share\company HR\*.* \\SharePointserver\share\library

However, this sometimes cannot work because of special characters in filename. I am thinking of changing to powershell with replacement of characters using regex.

Can someone guide me how such a script can be written as I am not sure what command to use for the powershell.
Question by:NicksonKoh
    LVL 38

    Accepted Solution

    LVL 38

    Expert Comment

    LVL 17

    Author Comment

    Hi Ach,

    Thx for the reference but those point to replacement of the text content in the files. I am looking to replace special character in the filenames.
    LVL 38

    Expert Comment

    The first one is specific to filenames.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    733 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

    23 Experts available now in Live!

    Get 1:1 Help Now