;***************************** ;* RoboTask Task file ;* Do not edit in text editor! ;***************************** [Root] ActionAfterRun=INTEGER|0 Actions=FOLDER Automat=INTEGER|-1 CatID=INTEGER|235983816 Comment=STRINGLIST ContinueOnError=INTEGER|0 DisableOnError=INTEGER|0 DoNotStopWhenShutdown=INTEGER|0 ExternalName=STRING|"Task1497" Hide=INTEGER|0 ID=INTEGER|1290167819 LogOnAsUser=INTEGER|1 Name=STRING|"Calc the folder size with basic script" OnErrorTaskID=INTEGER|-1 Priority=INTEGER|3 RunOnClose=INTEGER|0 RunOnStartup=INTEGER|0 ToLog=INTEGER|3 UnicodeFormat=INTEGER|1 WriteGeneralLog=INTEGER|0 [Actions] Action1=FOLDER Action10=FOLDER Action2=FOLDER Action3=FOLDER Action4=FOLDER Action5=FOLDER Action6=FOLDER Action7=FOLDER Action8=FOLDER Action9=FOLDER [Actions\Action1] ActionID=STRING|"A_DIALOG_BROWSEFOLDERS" Enabled=INTEGER|-1 Name=STRING|"Browse for Folders" Params=FOLDER [Actions\Action1\Params] caption=STRING|"Select Folder" default=STRING|"None" filter=STRING|"Text files|*.txt|All files|*.*|" variable=STRING|"FOLDER_TO_CALC" [Actions\Action10] ActionID=STRING|"A_VARIABLES_REMOVE" Enabled=INTEGER|-1 Name=STRING|"Remove variable ""FILECOUNT""" Params=FOLDER [Actions\Action10\Params] varname=STRING|"FILECOUNT" [Actions\Action2] ActionID=STRING|"A_FLOW_IF" Enabled=INTEGER|-1 Name=STRING|"If Then" Params=FOLDER [Actions\Action2\Params] case=STRING|"0" operator=STRING|"0" type=STRING|"0" value1=STRING|"{folder_to_calc}" value2=STRING|"none" [Actions\Action3] ActionID=STRING|"A_DIALOG_MESSAGE" Enabled=INTEGER|-1 Name=STRING|"Show ""You haven't chosen the folder""" Params=FOLDER [Actions\Action3\Params] icon=STRING|"1" msg0=STRING|"You haven't chosen the folder" msgcount=STRING|"1" playsound=STRING|"0" showmessage=STRING|"1" [Actions\Action4] ActionID=STRING|"A_FLOW_ELSE" Enabled=INTEGER|-1 Name=STRING|"Else" [Actions\Action5] ActionID=STRING|"A_SCRIPT_VBSCRIPT" Enabled=INTEGER|-1 Name=STRING|"VB Script" Params=FOLDER [Actions\Action5\Params] expandvars=STRING|"0" line00000000=STRING|"Set objFSO = CreateObject(""Scripting.FileSystemObject"")" line00000002=STRING|"objStartFolder = RoboTaskApp.ExpandText(""{FOLDER_TO_CALC}"")" line00000003=STRING|"cnt = 0" line00000005=STRING|"function GetFldSize(AFolderName)" line00000006=STRING|" total = 0" line00000008=STRING|" LogMessage(AFolderName)" line0000000A=STRING|" Set objFolder = objFSO.GetFolder(AFolderName)" line0000000B=STRING|" Set colFiles = objFolder.Files" line0000000D=STRING|" For Each objFile in colFiles" line0000000E=STRING|" 'LogMessage(objFile.Name)" line0000000F=STRING|" total = total + objFile.size" line00000010=STRING|" cnt = cnt + 1" line00000011=STRING|" Next" line00000013=STRING|" Set colFolders = objFolder.SubFolders" line00000014=STRING|" For Each objFolder in colFolders" line00000015=STRING|" 'LogMessage(objFolder.Name)" line00000016=STRING|" total = total + GetFldSize(AFolderName + ""\"" + objFolder.Name)" line00000017=STRING|" Next" line00000019=STRING|" GetFldSize = total" line0000001A=STRING|"end Function" line0000001C=STRING|"sz = GetFldSize(objStartFolder)" line0000001D=STRING|"LogMessage(cstr(cnt)+"" files; size:""+cstr(sz))" line0000001F=STRING|"RoboTaskApp.SetUserVariable ""FileCount"", cstr(cnt)" line00000020=STRING|"RoboTaskApp.SetUserVariable ""TotalSize"", cstr(sz)" linecount=STRING|"34" savescript=STRING|"0" [Actions\Action6] ActionID=STRING|"A_DIALOG_MESSAGE" Enabled=INTEGER|-1 Name=STRING|"Show ""Folder ""{Folder_To_Calc}"" contains """ Params=FOLDER [Actions\Action6\Params] icon=STRING|"1" msg0=STRING|"Folder ""{Folder_To_Calc}"" contains " msg1=STRING|"{FileCount} files" msg2=STRING|"{TotalSize} bytes" msgcount=STRING|"3" playsound=STRING|"0" showmessage=STRING|"1" [Actions\Action7] ActionID=STRING|"A_FLOW_ENDIF" Enabled=INTEGER|-1 Name=STRING|"End If" [Actions\Action8] ActionID=STRING|"A_VARIABLES_REMOVE" Enabled=INTEGER|-1 Name=STRING|"Remove variable ""FOLDER_TO_CALC""" Params=FOLDER [Actions\Action8\Params] varname=STRING|"FOLDER_TO_CALC" [Actions\Action9] ActionID=STRING|"A_VARIABLES_REMOVE" Enabled=INTEGER|-1 Name=STRING|"Remove variable ""TOTALSIZE""" Params=FOLDER [Actions\Action9\Params] varname=STRING|"TOTALSIZE"