1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

    Joined:
    Jun 17, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi

    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