Essentially, parameters $P, $C and $U are null if the folder in focus has no files, but $L and $R are set. Easily tested with this simple VBS:
Code: Select all
' x2 cmd line: > wscript.exe TestArgs.vbs "$P" "$C" "$U" "$L" "$R"
' ARGUMENT COUNT ALWAYS RETURNS "5"
MsgBox "Arguments.Count = [ " & WScript.Arguments.Count & " ]", 0
' ARGUMENTS ARE NULL STRINGS IF NO FILES EXIST IN FOLDER
msg = "Arguments: " & vbCrlf & _
"$P = [ " & WScript.Arguments.Item(0) & " ]" & vbCrlf & _
"$C = [ " & WScript.Arguments.Item(1) & " ]" & vbCrlf & _
"$U = [ " & WScript.Arguments.Item(2) & " ]" & vbCrlf & _
"$L = [ " & WScript.Arguments.Item(3) & " ]" & vbCrlf & _
"$R = [ " & WScript.Arguments.Item(4) & " ]" & vbCrlf & _
"End of Arguments"
MsgBox msg, 0
This is true for folders newly created or folders with all files and folders deleted.Arguments:
$P = [ ]
$C = [ ]
$U = [ ]
$L = [ D:\INACTIVE PANE ]
$R = [ F:\New Folder ]
End of Arguments
Add a file or folder into the folder and now $P and $C return the expected strings.
Arguments:
$P = [ F:\New Folder ]
$C = [ New Folder ]
$U = [ F:\New Folder\x2scrap.png ]
$L = [ F:\INACTIVE PANE ]
$R = [ F:\New Folder ]
End of Arguments
Is this expected behavior?
------------------------------
PJ in (IT'S FINALLY FALL) FL
(edit: corrected error in the output box for "populated" folder.)