Script Untuk Mengamankan Flashdisk Dari Virus

Kadang ketika kita dari warnet untuk mengupload file atau sejenisnya ataupun dilab Komputer Kampus , setibanya di rumah flashdisk terdapat tamu tak diundang, klo ga virus sality. Padahal antivirus di warnet sudah pake salah satu antivirus lokal yang suka mengeluarkan updatean, kok ga terdeteksi ya . Akhirnya capek lagi untuk mengcopy file2 program yang saya wajibkan di flashdisk ) akhirnya saya menemukan program untuk memprotek flashdisk.
disini kami membuatnya pake delphi.7
Untuk cara Penggunaannya
1.Silakan  buka notepad
2.copy scrip dibawah  lalu paste di notepad Atau Download Disini
3.klik file save as filename ‘USBWriteableAdjuster.exe’
4.simpan file tersebut di flashdisk .buat keamanan klik kanan file tersebut propertis general centang kata “hidden”
Untuk Mendownload file jadinya : Disini

___________________________________
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, registry, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure showCurrentStatus;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
regKey = ‘\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies’;
regValue = ‘WriteProtect’;
var
Form1: TForm1;
currentVal: integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
with TRegistry.Create do
begin
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey(regKey, true) then
begin
if currentVal = 0 then
WriteInteger(regValue, 1)
else
WriteInteger(regValue, 0);
end;
finally
free;
end;
end;
except
on E:Exception do
begin
showmessage(’Error updating registry’);
end;
end;
showCurrentStatus;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
showCurrentStatus;
end;
procedure TForm1.showCurrentStatus;
begin
try
with TRegistry.Create do
begin
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKey(regKey, false) then
begin
currentVal := ReadInteger(regValue);
if currentVal = 0 then
label1.caption := ‘Current status: Your USB disk is now WRITEABLE’
else
label1.caption := ‘Current status: Your USB disk is now READ ONLY’;
end
else
begin
label1.caption := ‘There is no current setting for your USB disk.’;
currentVal := 0;
end;
finally
free;
end;
end;
except
on E:Exception do
begin
showmessage(’Error reading current status from registry’);
label1.caption := ‘There is no current setting for your USB disk.’;
currentVal := 0;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
WinExec(’explorer.exe http://anggiawan.web.id’,SW_NORMAL);
end;
end.
__________________________________________

Semoga bermanfaat.

Jika menurut sobat artikel ini bermanfaat, silahkan vote ke Lintas Berita agar artikel ini bisa di baca oleh orang lain.

Ingin artikel seperti diatas langsung ke Email anda? Silahkan masukan alamat email anda untuk berlangganan



Artikel Terkait:

3komentar:

Posting Komentar

 

Traffic Pengunjung

free counters SEO Stats powered by MyPagerank.Net Msn bot last visit powered by MyPagerank.Net review http://vacoem.blogspot.com on alexa.com powered by Fresh counter Yahoo bot last visit powered by  Ybotvisit.com
hit counter code Free web Counter Log Counter powered by  http://www.myusersonline.com

Pengikut