We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

VbScript, CopyFolder with UserID & Password

ramadadi
ramadadi asked
on
Medium Priority
477 Views
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 \192.168.1.56\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\", "\\192.168.1.56\eTeams2008_bkup\", True
 
but for this location  \192.168.1.56\eTeams2008_bkup\ it is asking userID, password. how to inclued the user id and password in the above code.

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2006
Commented:
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)

http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_24009504.html

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.