24x7 supports 2 scripting languages - JAL (Job Automation Language) and VBScript. Do not confuse them. It looks like you have tried to insert your VBSCript into a JAL script job. There are may way how you can run your VBScript, but by far the most simple is to create a program type job and use the very same command that you used with the Windows task scheduler. In case if you want to run it as an internal job you will need to copy/paste your script into a VBScript job between "Sub Main" and "End Sub"lines. In case if you prefer using JAL you can convert the entire thing into a very simple one-line script (see the following example) // Example RegistrySetKey "HKEY_LOCAL_MACHINE\SOFTWARE\BMO System Info\HostName", "@V"computer"" That's it. : ComputerName : As a matter of fact, : I would like to run the following on a remote machine: : ______________________________________________________________ : MySysInfo.vbs: Const HKEY_LOCAL_MACHINE = &H80000002 : strComputer = "." : Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" : & _ : strComputer & "\root\default:StdRegProv") : strKeyPath = "SOFTWARE\My_ System_Info" : objReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath : Dim WshShell, MachineModel : Set WshShell = WScript.CreateObject("WScript.Shell") : Set WSHShell = CreateObject("WScript.Shell") : set o = CreateObject("WScript.Shell") : RegKey = : "HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName" : ComputerName = WSHShell.RegRead(RegKey & "") : o.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\BMO System Info\HostName:", : ComputerName : : __________________________________________________________________________________ : It works, when I run it locally with out any error message. Also I ran this : on a remote machine via Task Scheduler by typing the following in the RUN : window: CSCRIPT \\My_IP_Address\My_Share_Name\MySysInfo.vbs and runs with : out any error message. : But, a task assigned to me to implement the above via 24x7. : I tried the following: Dim Test_Job : Test_Job="MySysInfo" : @SCRIPT: \\My_IP_Address\My_Share_Name\MySysInfo.vbs : and I receive the following error message: An error occurred while executing : automation script: Line 1: Invalid datatype : Please help me out to resolve this issue. : Shaikh
|