P1nky
2012-02-21 08:39:50
Hallow Mates, I was wondering if it is possible to delete a script/file located anywhere in a Computer (Downloads folder/Desktop/Scripts folder/etc..), using SIMBA.
2012-02-21 08:39:50
2012-02-21 08:56:27
begin
if DeleteFile(apppath+'Rimmington0.bmp')then
writeln('file deleted');
end.
2012-02-21 09:11:52
2012-02-21 10:22:45
program FileDeleter;
Function UpdaterCheck: boolean;
var
Files: TStringArray;
I: Integer;
begin
//If Script out of date.. then.. delete it.. or whatever reason you want to delete them :S
Result:= False;
Files := GetFiles('C:/Simba/Scripts', '.simba');
For I := 0 To High(Files) do
if (ExecRegExpr('Waterfiends | waterfiends', Files[I])) then
if DeleteFile(Files[I]) then
Result:= True;
end;
begin
UpdaterCheck;
end.
2012-02-21 11:08:37
program new;
function ExtractFileInfo(const Filename: string): TStringArray;
var
StrArr, _Temp: TStringArray;
begin
SetLength(Result, 2);
StrArr := Explode('\', Filename);
_Temp := Explode('.', StrArr[High(StrArr)]);
Result[1] := _Temp[High(_Temp)];
SetLength(StrArr, Length(StrArr) - 1);
Result[0] := Implode('\', StrArr) + '\';
end;
function DeleteFiles(const Method, Filename: string): boolean;
var
H, I: LongInt;
Files, Info: TStringArray;
V: TVariantArray;
begin
Result := False;
SetLength(V, 1);
Info := ExtractFileInfo(Filename);
Files := GetFiles(Info[0], Info[1]);
H := High(Files);
for I := 0 to H do
begin
V[0] := Files[I];
if (CallProc(Method, V)) then
if (DeleteFile(Files[I])) then
Result := True;
end;
end;
function MyCheckMethod(const Filename: string): boolean;
begin
Result := False;
WriteLn(Filename);
end;
begin
DeleteFiles('MyCheckMethod', 'C:\Users\John\Desktop\Simba\Scripts\script.simba');
end.
2012-02-21 11:24:46
2012-02-21 11:27:37
From: ggzz
Dgby wouldn't that have to have a static location and script name? If I'm correct what he wants to do is to iterate through all folders on the computer, find simba scripts.. if they match the name of his, then delete :S??
And I think you meant:
if (CallProc(MyCheckMethod, V)) then <— You don't have a function called Method & MyCheckMethod returns false always?
2012-02-21 12:07:17
2012-02-21 12:29:02
From: kitchenrange
couldn't someone just rename the file to get around this?
2012-02-21 17:01:26
From: Dgby714
He prob just wants it for his updater, to delete old versions of the script…
2012-02-21 17:09:21
2012-02-21 17:16:28
From: Harry
Making the PCer attack portals would even out the issues you have with the bots ruining PC. Deleting files automatically is a recipe for disaster.
2012-02-21 20:23:50