VbScript, CopyFolder with UserID & Password

Posted on 2009-02-18
Last Modified: 2012-05-06
Hi Experts,

In the VB script, i need to copy one folder, from one locatin to another  in different system.

lets say Source : "\iacdev\eTeams2008 Source\"
Destination is \\eTeams2008_bkup\
Destination path is not accessible directly, i need to enter the domain name and password. how to include the user name and password, with copy folder in vbscript

Thanks Urgent
Set objFSO = CreateObject("Scripting.FileSystemObject")

    Const OverwriteExisting = TRUE

    objFSO.CopyFolder "\\iacdev\eTeams2008 Source\", "\\\eTeams2008_bkup\", True

but for this location  \\eTeams2008_bkup\ it is asking userID, password. how to inclued the user id and password in the above code.

Open in new window

Question by:ramadadi
    1 Comment
    LVL 65

    Accepted Solution

    Dunno if this will work for you but can you use "net" commands inside your script? You would need to run something like WShell to run it or perhaps outside, set it up then call script

    see solution here (as well as WShell example)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Title # Comments Views Activity
    MS Visual Studio 2015 - Install Error 5 60
    Port v1 4 50
    Outlook 365 8 55
    Gpo settings to get Microsoft edge default page 3 30
    Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now