I cant get this script to work...
I want to copy myfile.vbs from CD-Rom drive to Autostart in All users folder. i used a similar but it called cmd.exe to do the copy.
This one works but i cant call for cmd in the enviroment that i'm using it, i have to convert it to vb only...
Pls help me!
I want to copy myfile.vbs from CD-Rom drive to Autostart in All users folder. i used a similar but it called cmd.exe to do the copy.
Code:
Dim value1, ws, strAstart, WSHshell
Set ws = WScript.CreateObject("WScript.Shell")
value1 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
strAstart = ws.RegRead (value1 & "Common Startup")
Const OverwriteExisting = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile ".\myfile.vbs" , " & Chr(34) & strAstart & Chr(34) & "\ , OverwriteExisting
This one works but i cant call for cmd in the enviroment that i'm using it, i have to convert it to vb only...
Code:
Call ws.Run("cmd.exe /c copy .\myfile.vbs " & Chr(34) & strAstart & Chr(34) & "\ /Y")
Pls help me!