VBA, VB script, dan Batch di Windows

Kumpulan kode VBA, VBScript dan Batch sederhana yang dapat digunakan langsung.


Copy berkas dengan File System Object

dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")

If filesys.FileExists("c:\folder_asal\berkas.txt") Then
	filesys.CopyFile "c:\folder_asal\berkas.txt", "c:\folder_tujuan\"
End If

Drag and drop berkas

Set objArgs = WScript.Arguments
For i = 0 to objArgs.Count - 1
	WScript.Echo objArgs(i)
Next

Referensi daftar perintah VBScript
https://ss64.com/vb/


Referensi VBA di situs Microsoft
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/visual-basic-language-reference