wsh (jscript) argument looping

Discussion in 'Software' started by jeisma, Aug 13, 2006.

  1. jeisma

    jeisma Private E-2

    hi!

    when i call this script, it doesnt display the arguments i passed:

    ======
    var oArgs;

    oArgs = WScript.arguments;

    if (oArgs.length != 4) {
    //send email saying no backup argument was found
    WScript.Echo("no argument was passed");
    WScript.quit();
    }
    else {
    WScript.Echo(oArgs.length);

    for(var i=0; i < oArgs.length; i++) {
    WScript.Echo(oArgs );
    }
    }
    ======

    any ideas why?


    thank you!

    joey
     
  2. matt.chugg

    matt.chugg MajorGeek

    I think you need to use .count instead of .length
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds