Hi i need your help ..
I would like to send this script via VBS to computers on my network.
I tried copy your script to remote computer and run it as remote admin..
But it isn work correct..:( and i don't know how to do it...
I make this...
On Error Resume Next
Const FOR_READING = 1
Const OverwriteExisting = TRUE
strComputer = "computers.txt"
font1 = "I:\VBS\Fonts\fontinstall.vbs"
font1file = "fontinstall.vbs"
font2 = "I:\VBS\Fonts\instal.bat"
font2file = "instal.bat"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strComputer) Then
Set objTextStream = objFSO.OpenTextFile(strComputer, FOR_READING)
Else
WScript.Echo "chybi computers.txt :o("
Wscript.Quit
End if
Do Until objTextStream.AtEndOfStream
strComputer = objTextStream.ReadLine
WScript.Echo VbCrLf & strComputer
WScript.Echo String(Len(strComputer), "-")
const HKEY_LOCAL_MACHINE = &H80000002
Set objFSO=CreateObject("Scripting.FileSystemObject")
ObjFSO.CreateFolder("\\" & strComputer & "\c$\install")
ObjFSO.CreateFolder("\\" & strComputer & "\c$\install\Fonts")
ObjFSO.CopyFile font1, "\\" & strComputer & "\c$\install\Fonts\" & font1file , OverwriteExisting
ObjFSO.CopyFile font2, "\\" & strComputer & "\c$\install\Fonts\" & font2file , OverwriteExisting
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\cimv2:Win32_Process")
strCommand = "C:\install\Fonts\fontinstall.vbs"
errReturn = objWMIService.Create(strCommand,null,null,intProcessID)
Loop
I run this script copy your script to remote computer and run your script on remote computer.