1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

problem in running a file in remote machines mapped drive

Discussion in 'Visual Basic ( VB )' started by DivyaTheja, Jun 17, 2010.

  1. DivyaTheja

    DivyaTheja New Member


    I am facing problem when running a vbscript file in local machine which starts a program in remote machine (program located in mapped drives).
    I tried win32Scheduledjob and AT commands. but these are working when a file is in harddisk drives but not in mapped drives. With ScheduledJob and win32_process its running in background. I want a program to run interatively in remote machine.

    Please help me out.

    Code i wrote was:
    strCommand = "wscript.exe L:\UITest\Utilities\Auto\AutoInstallRun.vbs "+strComputer
    strComputer = "nbhyddpachipu"

    Const INTERVAL = "n"
    Const MINUTES = 1

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob")
    Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime")

    objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now()))
    errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID)

Share This Page