// ON RULE BEGIN PASCAL SCRIPT Var iList: Integer; tmpDir: String; tmpList: TStringList; Const ctUsersDir = 'C:\Users'; // No backslash at the end ctDesktopSubDir = 'Desktop\Export'; Begin psExitCode:= 0; psVSA := ''; // ... add your code here tmpList := TStringList.Create; Try psListPaths(ctUsersDir, '*.*', 1, tmpList); psLogWriteStr(tmpList.Text); // Iterate For iList := 0 To (tmpList.Count-1) Do Begin tmpDir := tmpList.Strings[iList] + ctDesktopSubDir; If DirectoryExists(tmpDir) Then Begin If psVSA = '' Then psVSA := tmpDir Else psVSA := psVSA + ';' + tmpDir; End Else psLogWriteStr('Directory does not exist: ' + tmpDir); End; psLogWriteStr('psVSA: ' + psVSA); // Set Result if at least one Export folder was found If psVSA <> '' Then psExitCode := 1; Finally tmpList.Free; End; End. // DESTINATION PASCAL SCRIPT Var tmpList: TStringList; Const ctUserIndex = 1; Begin psExitCode:= 1; psVSB := ''; // ... add your code here tmpList := TStringList.Create; Try tmpList.QuoteChar := #0; tmpList.Delimiter := '\'; tmpList.StrictDelimiter := True; tmpList.DelimitedText := psFileDir; psLogWriteStr('psFileDir: ' + psFileDir); psVSB := tmpList.Strings[tmpList.Count - 3]; psLogWriteStr('psVSB: ' + psVSB); Finally tmpList.Free; End; End.