Link to home
Start Free TrialLog in
Avatar of DannyIce
DannyIce

asked on

Xcopy in VBS

I need to turn the following bat logon script into a VBS instead. can someone tell me how to do this?

@echo off
xcopy "\\xxx.local\NETLOGON\Signatures\%USERNAME%\*.htm" "%USERPROFILE%\Application Data\Microsoft\Signatures" /Y /I /Q
xcopy "\\xxx.local\NETLOGON\Signatures\%USERNAME%\*.jpg" "%USERPROFILE%\Application Data\Microsoft\Signatures" /Y /I /Q


This also may need to be different for vista users.
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, you can try this too, in case the %USERNAME% and %USERPROFILE% values don't expand for you.

Regards,

Rob.
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
strUserName = objShell.ExpandEnvironmentStrings("%USERNAME%")
strUserProfile = objShell.ExpandEnvironmentStrings("%USERPROFILE%")
objShell.Run "xcopy " & chr(34) & "\\xxx.local\NETLOGON\Signatures\" & strUserName & "\*.htm" & chr(34) & " " & chr(34) & strUserProfile & "\Application Data\Microsoft\Signatures" & chr(34) & " /Y /I /Q"
objShell.Run "xcopy " & chr(34) & "\\xxx.local\NETLOGON\Signatures\" & strUserName & "\*.jpg" & chr(34) & " " & chr(34) & strUserProfile & "\Application Data\Microsoft\Signatures" & chr(34) & " /Y /I /Q"

Open in new window

Avatar of DannyIce
DannyIce

ASKER

Excellent - good man!
Happy to help - thanx for the grade! :^)