Windows Server TechCenter > Windows Server Forums > Windows Server 2008 R2 Management > ClientAgent.vbs Script error line:11 Char:5
Ask a questionAsk a question
 

AnswerClientAgent.vbs Script error line:11 Char:5

  • Friday, October 16, 2009 2:21 PMFD1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello Peers,

    We are getting this error on all desktop XP and maybe others when emd user logs in to PC. See error below I notice this error after accessing the "ClientAgent.vbs" on the server to see it content.

    Script:\\melcolocal\SysVol\melco.local\ClientAgent.vbs   Line:11   Char:5  Error:The system cannot find the file specified  Code:80070002   Source:(null)

    the contet is listed
    ----------------------
    Path = UCase(Trim(WScript.Arguments(0)))
    set argv = WScript.Arguments

    if( Right(Path,4) = ".EXE" ) then
        Set WshShell = WScript.CreateObject("WScript.Shell")
        args = ""
        For i = 0 to argv.Count - 1
            args = args & Trim(argv(i)) & " "
        Next

        WshShell.run args,0,True
    else
        DstPath = UCase(Trim(WScript.Arguments(1)))
        set fso = CreateObject("Scripting.FileSystemObject")
        fso.CopyFile Path, DstPath, FALSE
    end if
    ---------------------------------

    Can anyone look at this script and see if it different from what is suppose to be?


    Smarthost Design Technologies LLC
     

    Smarthost Design Technologies LLC

Answers

  • Monday, October 19, 2009 2:28 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    The script has two functions.

    1. If the first argument is .EXE file, it will compose the shell command as the combination of all but the last parameter. After that, it will execute the shell command
    2. If the first argument is not .EXE file, it will perform copy file operation from the source file which is specified by the first argument to the destination file which is specified by the second argument.

    Line:11   Char:5  is "WshShell.run args,0,True". It seems that the argument is not correct or cannot be found. Please let us know the detailed parameter for research.

    As this issue is related to your custom script, I suggest that you initial a new post in The Official Scripting Guys Forum! to get further support there. They are the best resource for scripting related problems.

    The Official Scripting Guys Forum!
    http://social.technet.microsoft.com/Forums/en-US/ITCG/threads

    Mervyn

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com  


    This posting is provided "AS IS" with no warranties, and confers no rights.

All Replies

  • Friday, October 16, 2009 10:49 PMMarco ShawMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This is a Server 2008 R2 forum.

    From what I can tell, this script expects to be passed the full path to an .exe file.  You need to determine whether that .exe file that is being passed, still exists.
  • Monday, October 19, 2009 2:28 AMMervyn ZhangMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    The script has two functions.

    1. If the first argument is .EXE file, it will compose the shell command as the combination of all but the last parameter. After that, it will execute the shell command
    2. If the first argument is not .EXE file, it will perform copy file operation from the source file which is specified by the first argument to the destination file which is specified by the second argument.

    Line:11   Char:5  is "WshShell.run args,0,True". It seems that the argument is not correct or cannot be found. Please let us know the detailed parameter for research.

    As this issue is related to your custom script, I suggest that you initial a new post in The Official Scripting Guys Forum! to get further support there. They are the best resource for scripting related problems.

    The Official Scripting Guys Forum!
    http://social.technet.microsoft.com/Forums/en-US/ITCG/threads

    Mervyn

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com  


    This posting is provided "AS IS" with no warranties, and confers no rights.