#----------------------------------------------------------------------------- # File: ChangeMaxDataSend.eps # # Changes the ID of the given file #----------------------------------------------------------------------------- @echo off; if ($argc != 3) { echo "Usage: $argv[0] "; return false; } string $file = $argv[1]; string $MaxDataSend = $argv[2]; #string $startHour = $argv[2]; #string $endHour = $argv[3]; @record on; # get full path to original file ifnot (`getdirectory -resources`) { echo "* ChangeMaxDataSend: Unable to get resources directory"; return false; } string $resDir = GetCmdData("dir"); ifnot (defined($resDir[0])) { echo "* ChangeMaxDataSend: Unable to retrieve resources directory"; return false; } # see if it's already a full path string $fullPath; string $parts = Split(":", $file); if (sizeof($parts) > 1) { # path is a full path $fullPath = $file; } else { $fullPath = "$resDir\\$file"; } # get logs directory ifnot (`getdirectory -logs`) { echo "* ChangeMaxDataSend: Unable to get logs directory"; return false; } string $currentDir = GetCmdData("dir"); ifnot (defined($currentDir[0])) { echo "* ChangeMaxDataSend: Unable to retrieve logs directory"; return false; } # get filename string $fileParts = Split("\\", $file); int $lastPart = sizeof($fileParts); $lastPart--; string $fileName = $fileParts[$lastPart]; ifnot (defined($fileName[0])) { echo "* ChangeMaxDataSend: Unable to determine file name"; return false; } $fileName = "$currentDir\\$fileName-MDS$MaxDataSend"; # set the time ifnot (`local run -command "$resDir\\PC\\Tools\\PCConfig.exe -proxy -inFile \\"$fullPath\\" -outFile \\"$fileName\\" -maxData $MaxDataSend"`) { echo "* ChangeMaxDataSend: Max Data set failed"; return false; } echo "Max Data Send set for $fileName"; return SetCmdData(STRING, "file", $fileName);