Selasa, Juli 28, 2009

Solved: Windows cannot start the Windows Firewall/ICS service

When go to Control Panel and double click on Windows Firewall, then get a prompt saying "Windows Firewall settings cannot be displayed because the associated service is not running" and it asks me whether I "want to start the Windows Firewall/Internet Connection Sharing (ICS) service."
Solved it by : From the Command Prompt, enter:

netsh winsock reset

Minggu, Juni 01, 2008

Default Path Direktory.

Tiba tiba saya tergelitik untuk membahas perbedaan antara command Sys(5)+Sys(2003) dengan Sys(16) untuk menentukan Direktori dimana Program kita berada.

Banyak rekan-rekan sesama Foxers menyarankan untuk menggunakan yang pertama . Alasannya paling simple, cukup dengan membuat command tersebut, maka default Path Direktory dimana Program kita berada sudah Ok. Praktis dan mudah.

Tapi tahukan anda jika tidak hati2 maka penggunaan command pertama tsb bisa bermasalah.

Berdasarkan Help VFP sendiri:
Sys(5) = Default drive or volume.
Sys(2003) = Current directory.
Jadi dengan menjalan command tsb, system akan menempatkan default direktori secara otomatis ketempat mana dia diexecutin. Ketika kita menjalankan program dari direktori asal program tsb, maka secara otomatis default direktory juga terset ketempat itu.

Tapi apa jadinya jika kita tidak meng executing program dari tempat tersebut ?

Misal, pertama kali membuka program Microsfoft Visual Foxpro 9 yang mana defaultnya adalah HOME()="C:\Program Files\Microsoft Visual Foxpro 9\". Nah, tentu saja Perintah Sys(5)+Sys(2003) justru akan mengacaukan alamat default direktori program yang sudah kita rancang. Karena default tidak berada ditempat semestinya tapi justru di HOME() dari VFP itu sendiri.

Bagaimana dengan command Sys(16) yang menurut Help Vfp sendiri berarti 'Executing program file name'.

Justru menurut saya ini adalah langkah paling aman yang mesti gunakan. Walau dalam penggunaan command ini sedikit lebih ribet dan panjang dari langkah pertama , tapi default program kita lebih terjamin berada ditempat yang seharusnya.

Berikut adalah modifikasi prosedur yang selama ini saya mamfaatkan selama ini untuk membuat sebuah program awal (main procedur), barangkali bisa bermamfaat bagi rekan2 sesama fox mania.

Public PbPath
cCurr= Sys(16,1)
nPath= At(":",cCurr)-1
If nPath<1 npath="1">&&& Fungsi ini boleh diabaikan karena hanya bermamfaat untuk menghilangkan error yang tidak perlu, jika Program kita executing dari jaringan Network.
Endif
lPath = Rat("\", cCurr) -
(nPath)
PbPath=Alltrim(Substr(cCurr, nPath, lPath))
* Publis Global Variable bermamfaat saat suatu ketika kita memindahkan default ke tempat lain
dan untuk mereset ke Direktory awal cukup dengan merecallnya kembali. Anda Boleh juga mengabaikan untuk mempublis fungsi ini untuk memperpendek pengetikan prosedure.
Set Default To (PbPath)
Jauh lebih panjang dari cuma membuat command Sys(5)+Sys(2003), akan tetapi kita lebih terjamin berada di default direktory yang sebenarnya.

Kamis, Mei 29, 2008

virus KSPOOLD dan Langkah untuk merecovey

Langkah untuk merecover file DBF yang rusak oleh virus KSPOOLD

Kerusakan data yang disebabkan oleh virus KSPOOLD adalah mengganti header dari file yang berextension DBF (Kalau file data dbf yg sudah diganti extensionnya, tidak diserang). Karena header setiap file dbf tidak sama ukurannya, ini tergantung dari jumlah field, maka untuk file yang jumlah fieldnya sedikit, virus bisa menyerang record. Hal ini diperhatikan karena disengaja oleh pembuatnya agar ukuran file tidak berubah. Untuk memperbaiki header file dbf yang rusak bisa dilakukan dengan bantuan utility UltraEdit yang dapat di download versi trial nya di :
http://www.tucows.com/preview/194610


Langkah perbaikan :
1. Buka file dbf yang rusak
2. Buka file yang masih baik dgn struktur yang sama dengan file yang rusak, atau buat file baru yang strukturnya sama dgn file yang rusak


http://www.4freeimagehost.com/resized/661e423da80b.jpg

3. Blok header data yang clean mulai dari batas header dgn record sampai ke awal file, klik
kanan pilih copy



http://www.4freeimagehost.com/resized/356df9b42c02.jpg

4. Blok header data yang rusak mulai dari batas antara header dgn record sampai awal file, klik kanan pilih paste




http://www.4freeimagehost.com/resized/b505b91753db.jpg
5. Simpan data yang rusak dgn cara masuk ke Menu, Pilih File lalu Save. Perbaikan data tahap pertama sudah selesai, hasilnya masih belum bisa dibaca oleh VFP, karena jumlah record yang tercatat pada data yang rusak tidak sama dengan yang di kopikan.
6. Perbaikan selanjutnya saya menggunakan tool yang berfungsi untuk memperbaiki header file dbf yg kerusakannya tidak parah dgn Tabel Repair Utility (Program Terlampir)
7. Klik Pilih File, cari file yang disimpan melalui UltraEdit, ini tampilannya

8. Klik Tombol Ganti Pada baris jumlah Recor
9. Klik Tombol Ganti Pada baris ukuran file
10. Bila File yg Anda Recover mempunyai Field Memo sedangkan file memonya tidak tersedia, ubah Table Flag menjadi Has CDX File, kemudian klik Ganti.
11. Klik Buka File ...untuk membuka file yang sudah di recover, pada bagian bawah terdapat record sampah, buang saja .. !

Data yang rusak sudah bisa diselamatkan.

Semoga dapat membantu.
Salam Fox Mania.

(Kutipan dari PaissiaP al. Ismuddin mailto:ismuddin@yahoo.com)

Kill Virus KSPOOLD

Buat File BAT dengan menggunakan Notepad serta berilah namanya sesuai keinganan anda (mis. kspoold_killer.bat) dan simpan kedalam ext bat.

Copy pastekan command dibawah ini kedalam file tsb. Jangan lupa untuk menyimpannya balik.

echo off
cls
REM — ubah warnacolor a
REM — ubah judultitle KSPOOLD KILLER * by M. Husni Adil
REM — masuk ke
direktori sistem%SYSTEMDRIVE%cd %SYSTEMROOT%\system32
echo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo KSPOOLD KILLER * by M. Husni
Adilecho ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo After you press any
keys on your keyboard, I doecho - removing related registryecho - stopping
kspoold processecho - deleting kspoold file in the system directoryecho
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo.
pause
echo.REM —
hapus registry yang dibuat sebagai service virusreg delete
“HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\kspooldaemon” /freg delete
“HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\kspooldaemon” /freg delete
“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kspooldaemon” /f
REM —
hentikan proses virustaskkill /IM kspoold.exe /F /T
REM — set atribut file
virus menjadi normalattrib -s -h -r kspoold.exe
REM — hapus file virusdel
kspoold.exe
cls
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo
KSPOOLD KILLER * by M. Husni Adilecho
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo After you press any keys on
your keyboard, I doecho - removing related registryecho - stopping kspoold
processecho - deleting kspoold file in the system directoryecho
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo.echo Press any key to
continue . . .echo.
echo Well done - The “kspoold” was completely
removedecho.
pause

Get a Serial

*!*Get a serial#
LPARAMETERS drvPath
IF PCOUNT()=0
drvPath = "C:"
ENDIF
LOCAL FS,F1,cSerial
drvPath = IIF(LEN(drvPath)=1,drvPath+":",drvPath)
fs = CreateObject("Scripting.FileSystemObject")
f1 = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvPath)))
cSerial = f1.SerialNumber
RELEASE fs,f1
RETURN RIGHT(TRANSFORM(cSerial, "@0"), 8)

Rabu, Mei 28, 2008

Select Dengan Limit

TEXT TO sqlcmd PRETEXT 3 NOSHOW
SELECT user_id,pass_id,grup_id,nama_grup,pemakai.tanggal,pemakai.author from pemakai
inner join grup on pemakai.grup_id=grup.kode_grup order by user_id asc limit 10
ENDTEXT

Register Dll

***********************************************************************
* Download from : http://fox-mania.blogspot.com/
***********************************************************************
* Program....: REGISTER.PRG
* Compiler...: Visual FoxPro 07.00.0000.9465
* Purpose....: Wrapper to Select and Register DLL & EXE files
***********************************************************************
LPARAMETERS tlUnRegister, tcFile, tlNoShow
LOCAL llReg, lcTxt, lcFile, lcType, lnResult, lcCmd, lcParams, lcStr, lcMsg
*** Set the action flag based on first param
*** If EMPTY() assume .F., therefore REGISTER
*** IF NOT EMPTY() assume .T. and UN-REGISTER
llReg = IIF( EMPTY( tlUnRegister ), .F., .T. )
*** Set the GetFile Prompt accordingly
lcTxt = IIF( tlUnRegister, "UN-Register", "Register" )
IF VARTYPE( tcFile ) = "C" AND NOT EMPTY( tcFile )
*** We can assume we got a file name
IF FILE( tcFile )
*** And the file exists on the current search path
lcFile = FULLPATH( tcFile )
ELSE
*** We need to get it's full name and location
lcFile = GETFILE( 'DLL;EXE', lcTxt )
ENDIF
ELSE
*** Get the full name and location of the file
lcFile = GETFILE( 'DLL;EXE', lcTxt )
ENDIF
*** Did we end up with a file?
IF EMPTY( lcFile )
MESSAGEBOX( "No file specified to " + lcTxt, 64, "Nothing to do" )
RETURN
ENDIF
*** If we get this far we have a defined action, and a file name to work with
*** Set up the ShellExecute API function to run the process
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
INTEGER lnHWnd, ;
STRING lcAction, ;
STRING lcTarget, ;
STRING lcExeParams, ;
STRING lcDefDir, ;
INTEGER lnShowWindow
*** Populate the File and Parameter variables depending on the task
lcType = JUSTEXT( lcFile )
IF llReg
*** UNREGISTER
IF lcType = "DLL"
lcCmd = "REGSVR32"
lcParams = " /s /u " + lcFile
ELSE
lcCmd = lcFile
lcParams = " /unregserver"
ENDIF
ELSE
*** REGISTER
IF lcType = "DLL"
lcCmd = "REGSVR32"
lcParams = " /s " + lcFile
ELSE
lcCmd = lcFile
lcParams = " /regserver"
ENDIF
ENDIF
*** Now Call ShellExecute to run the registration
lnResult = ShellExecute( 0, 'open', lcCmd, lcParams, "", 1 )
*** Result >32 = Success, otherwise its an error code (see below for meaning)
IF lnResult <=32 AND NOT tlNoShow
*** Show the error list
TEXT TO lcStr NOSHOW
0 The operating system is out of memory or resources.
1 The function is incorrect.
2 The specified file was not found.
3 The specified path was not found.
5 Access denied
8 Out of memory
11 The .exe file is invalid (non-Win32® .exe or error in .exe image).
26 Sharing violation
27 Association incomplete or invalid
28 DDE request timed out
29 DDE transaction failed
30 Other DDE transactions were being processed
31 No application associated with file name extension or file is not printable
32 DLL Not found
ENDTEXT
lcMsg = UPPER(lcTxt) + " Operation failed with Error: " + TRANSFORM( lnResult ) + CHR(13) + CHR(10)
lcMsg = lcMsg + "Command Line = '" + lcCmd + " " + lcParams + "'" + CHR(13) + CHR(10)
lcMsg = lcMsg + " ----------------------------------------------------"+ CHR(13) + CHR(10)
lcMsg = lcMsg + lcStr
MESSAGEBOX( lcMsg, 16, 'API Call Failed' )
ENDIF
*** Return the result
RETURN lnResult