facing problem copying files through xcopy using vbscript

Posted by sushant on Stack Overflow See other posts from Stack Overflow or by sushant
Published on 2010-03-19T06:12:16Z Indexed on 2010/03/19 15:01 UTC
Read the original article Hit count: 179

Filed under:

i am using the following code. the problem is that folder location path has to be entered by user. assuming i put that path in a variable say "h", how do i call this variable in xcopy. here is the code i tried. please tell the correct syntax. Dim WshShell, oExec,g,h h="D:\newfolder"

g="xcopy $h D:\y\ /E"
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec(g)

i also tried "&h" but it did not work. any help is appreciated and sorry again, i dont know how to format it.

© Stack Overflow or respective owner

Related posts about vbscript