├── 1.Array.vbs ├── 1.Do.vbs ├── 1.Do_Until.vbs ├── 1.Do_While.vbs ├── 1.For.vbs ├── 1.For_Each.vbs ├── 1.Switch.vbs ├── 1.While.vbs ├── 1.if_else.vbs ├── 10.Notification for Closing program.vbs ├── 11.Open And Close Program Automatically.vbs ├── 12.Ping And Back Status.vbs ├── 13.Open NotePad Send Keystroke.vbs ├── 14.Get User Desktop location.vbs ├── 14.Get program Files Location.vbs ├── 15.Create Sortcuts on Specified Loc.vbs ├── 16.Create Web Url.vbs ├── 17.Print Reverse String.vbs ├── 2.Copy Files.vbs ├── 2.Create Folder.vbs ├── 2.Delete File.vbs ├── 2.Delete Folder.vbs ├── 2.Move File.vbs ├── 2.Move Folder.vbs ├── 3.Create Text File.vbs ├── 3.Open Text File Write Line.vbs ├── 3.Read File In Msg Box.vbs ├── 4.Attributes Files And Folder.vbs ├── 4.Change File Attributes.vbs ├── 4.Get File Size.vbs ├── 4.ReadFolder IN Folder.vbs ├── 5.Getdrive Letter.vbs ├── 6.Custum MSgBox.vbs ├── 7.View User Pic location.vbs ├── 8.Execute Program.vbs ├── 8.Run Program.vbs ├── 9.Get Procees Id And Status.vbs └── README.md /1.Array.vbs: -------------------------------------------------------------------------------- 1 | Dim no 2 | Dim n 3 | no = array("Martín","Pablo","Carlos") 4 | For each n in no 5 | Msgbox n 6 | next -------------------------------------------------------------------------------- /1.Do.vbs: -------------------------------------------------------------------------------- 1 | Do 2 | Msgbox "Unidentify error" 3 | Loop -------------------------------------------------------------------------------- /1.Do_Until.vbs: -------------------------------------------------------------------------------- 1 | Dim a 2 | a = 1 3 | Do until a=10 4 | Msgbox "Antivirus Error" 5 | a = a+1 6 | 7 | Loop -------------------------------------------------------------------------------- /1.Do_While.vbs: -------------------------------------------------------------------------------- 1 | Dim a 2 | a = 1 3 | Do while a<>10 4 | Msgbox "xcgs990mem" 5 | Loop -------------------------------------------------------------------------------- /1.For.vbs: -------------------------------------------------------------------------------- 1 | Dim i 2 | For i=1 to 5 step 1 3 | Msgbox "Blackhat: " & i 4 | Next -------------------------------------------------------------------------------- /1.For_Each.vbs: -------------------------------------------------------------------------------- 1 | Dim names (2) 2 | names (0) = "Martin" 3 | names (1) = "Paul" 4 | names (2) = "Carlos" 5 | Msgbox names (1) -------------------------------------------------------------------------------- /1.Switch.vbs: -------------------------------------------------------------------------------- 1 | Dim num 2 | num = 8 3 | Select case num 4 | case 6 5 | msgbox "6 " 6 | case 7 7 | msgbox "7 " 8 | case 8 9 | msgbox "8" 10 | End select -------------------------------------------------------------------------------- /1.While.vbs: -------------------------------------------------------------------------------- 1 | Dim Number 2 | Number = 1 3 | While number <= 10 4 | Msgbox number 5 | number = number + 1 6 | Wend -------------------------------------------------------------------------------- /1.if_else.vbs: -------------------------------------------------------------------------------- 1 | Dim var 2 | var = 12 3 | If var < 10 then 4 | Msgbox " True Statement " 5 | Else 6 | Msgbox " False Statement " 7 | End if -------------------------------------------------------------------------------- /10.Notification for Closing program.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set bloc = objshell.Exec("notepad") 3 | Do while bloc.status = 0 4 | Wscript.Sleep 200 'serves to pause for x milliseconds 5 | loop 6 | msgbox "has closed the notebook" -------------------------------------------------------------------------------- /11.Open And Close Program Automatically.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set bloc = objshell.Exec("notepad") 3 | Wscript.sleep 5000 'Pausa de 5000 milesimas, o 5 segundos 4 | bloc.terminate -------------------------------------------------------------------------------- /12.Ping And Back Status.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set ping = objshell.exec("cmd /c ping 127.0.0.1") 3 | Msgbox ping.stdout.readall -------------------------------------------------------------------------------- /13.Open NotePad Send Keystroke.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set bloc = objshell.exec ( "notepad" ) 'run notepad 3 | wscript.Sleep 2000 'wait two seconds 4 | objshell.appactivate bloc.processid 'we focus on the window notebook 5 | wscript.sleep 200 'espera de milesimas 6 | objshell.sendkeys "Tutorial vbs" 'send a message sendkeys 7 | objshell.sendkeys "{ENTER}" 'then the previous message, ENTER 8 | wscript.Sleep 2000 'new waiting two seconds 9 | Objshell.sendkeys "Testing the SendKeys function" 'send a second message line -------------------------------------------------------------------------------- /14.Get User Desktop location.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Msgbox objshell.specialfolders("Desktop") -------------------------------------------------------------------------------- /14.Get program Files Location.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Msgbox objshell.expandenvironmentstrings("%Programfiles%") -------------------------------------------------------------------------------- /15.Create Sortcuts on Specified Loc.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set Ellink = objshell.createshortcut( "H:\directo.lnk" ) 'create the link 3 | Ellink.targetpath = "C:\windows\notepad.exe" 'completamos los valores 4 | Ellink.windowstyle = 1 5 | Ellink.hotkey = "CTRL+SHIFT+N" 6 | Ellink.iconlocation = "C:\windows\notepad.exe,0" 7 | Ellink.description = "Acceso directo a notepad" 8 | Ellink.workingdirectory ="C:\" 9 | Ellink.save 'we save the link -------------------------------------------------------------------------------- /16.Create Web Url.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set weburl = objshell.createshortcut("H:\google.url") 3 | weburl.targetpath = "http://www.google.com" 4 | Weburl.save -------------------------------------------------------------------------------- /17.Print Reverse String.vbs: -------------------------------------------------------------------------------- 1 | msgbox strReverse("foro.elhacker.net") -------------------------------------------------------------------------------- /2.Copy Files.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Objfso.copyfile "H:\rtg.txt", "D:\gtr.txt", true -------------------------------------------------------------------------------- /2.Create Folder.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set micarpeta = objfso.createfolder("C:\carpeta") -------------------------------------------------------------------------------- /2.Delete File.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Objfso.deletefile "H:\ajay.txt" -------------------------------------------------------------------------------- /2.Delete Folder.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | objfso.deletefolder "H:\hack" -------------------------------------------------------------------------------- /2.Move File.vbs: -------------------------------------------------------------------------------- 1 | dim filesys 2 | set filesys=CreateObject("Scripting.FileSystemObject") 3 | If filesys.FileExists("D:\ajay.txt") Then 4 | filesys.MoveFile "D:\ajay.txt", "H:\" 5 | End If 6 | -------------------------------------------------------------------------------- /2.Move Folder.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Objfso.copyfolder "H:\hack", "D:\folder", true -------------------------------------------------------------------------------- /3.Create Text File.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set file = objfso.createtextfile ( "H:\file.txt" , true ) 'create the file 3 | file.writeline "This is the text I'm writing," 'write a line 4 | file.writeblanklines (2) 'write 2 lines blank 5 | file.writeline "Here more text" 'wrote another line of text 6 | file. close 'close the file -------------------------------------------------------------------------------- /3.Open Text File Write Line.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set archivotexto = objfso.opentextfile ( "H:\file.txt" , 8, true ) 'open the file 3 | archivotexto.writeline "This is the text I'm writing," 'write a line 4 | archivotexto. close -------------------------------------------------------------------------------- /3.Read File In Msg Box.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set archivotexto = objfso.opentextfile ( "H:\file.txt" , 1) 'open the file 3 | msgbox archivotexto.readline 'read a line, the first 4 | archivotexto.skipline 'skipping a line 5 | msgbox archivotexto.readline 'read a line, the third 6 | archivotexto. close 'close the file -------------------------------------------------------------------------------- /4.Attributes Files And Folder.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set file = objfso.getfile("H:\adf.pdf") 'get control over PDF file 3 | Msgbox file.attributes' message with the file ATTRIBUTES 4 | 5 | 'In this example we see that after declaring the object, what we do is get control of the tutorial.pdf file, for which we use getfile, and assign the file to the variable file. . Then and now with the file variable, we can use directly to display its attributes, which will be nothing but a number that will encompass all the attributes constants 6 | 'constants that refer to the file attributes are: 7 | 8 | 'Value 9 | '0 Normal 10 | '1 Read Only 11 | '2 Hidden 12 | '4 System 13 | '8 drive letter 14 | '16 folder / directory 15 | '32 File 16 | '64 Link or direct access 17 | '128 Compressed 18 | 19 | 'As I mentioned before, attributes return a single value will be the sum of each of the values ​​for each attribute of the file. 20 | 'For example: 21 | 'A file that has attributes; read-only, hidden, system, and archive, will be worth 1 + 2 + 4 + 32 = 39 Change Attributes Set variable = objfso.getfile (route) variable.attributes = sumaatributos Example: -------------------------------------------------------------------------------- /4.Change File Attributes.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set file = objfso.getfile( "H:\adf.pdf" ) 'get control over PDF file 3 | file.attributes = 34 'and hidden attribute will dearchivo -------------------------------------------------------------------------------- /4.Get File Size.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set file = objfso.getfile( "H:\adf.pdf" ) 'get control over PDF file 3 | Msgbox file.size 'file size in bytes -------------------------------------------------------------------------------- /4.ReadFolder IN Folder.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set myfolder = objfso.getfolder ("H:\support" ) 'we obtain control over the folder 3 | Set subfolders = myfolder.subfolders 'get the collection of subfolders 4 | For each s in subfolders 'for each folder (s) in the collection (sub) 5 | Msgbox s.name 'message with the name 6 | Next -------------------------------------------------------------------------------- /5.Getdrive Letter.vbs: -------------------------------------------------------------------------------- 1 | Set objfso = createobject("scripting.filesystemobject") 2 | Set discs = objfso.drives 'get record collection 3 | For each d in discs 'for each disk (d) in the collection (disks) 4 | Msgbox d.driveletter 'message drive letter 5 | Next -------------------------------------------------------------------------------- /6.Custum MSgBox.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("Wscript.shell") 2 | rmessage = objshell.popup ( "This is a test message" , 1 , "Message Popup" ,16) 3 | 'message 'time 'title 'icon 4 | 'Value Description 5 | '0 OK 6 | '1 OK and Cancel 7 | '2 Abort, Retry, and Ignor 8 | '3 Yes, No, and Cancel 9 | '4 Yes and No 10 | '5 Retry and Cancel 11 | 12 | 13 | '16 Stop / Error 14 | '32 Question 15 | '48 Exclamation 16 | '64 Information 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /7.View User Pic location.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Msgbox objshell.regread("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\My Pictures") 3 | 'It is all on one line, the key is too long -------------------------------------------------------------------------------- /8.Execute Program.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Objshell.Exec("notepad") -------------------------------------------------------------------------------- /8.Run Program.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Objshell.run "notepad", 1, true -------------------------------------------------------------------------------- /9.Get Procees Id And Status.vbs: -------------------------------------------------------------------------------- 1 | Set objshell = createobject("wscript.shell") 2 | Set bloc = Objshell.Exec("notepad") 3 | Msgbox bloc.status 4 | Msgbox bloc.processid -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Visual-Basic-Scripts 2 | Visual Basic Scripts Utilities. Fun, Automation, Fundamentals. With the help of these scripts, I develop lots of Exploits which I'm used for automation system tasks. these vb scripts I am also used for system security exploitation. 3 | 4 | ## Project Files 5 | 6 | # Basic Fundamentals 7 | 8 | ``` 9 | 1. Array 10 | 2. Do 11 | 3. Do Until 12 | 4. Do While 13 | 5. For 14 | 6. For Each 15 | 7. If else 16 | 8. Switch 17 | 9. While 18 | 19 | ``` 20 | # Automation & Fun 21 | 22 | ``` 23 | 1. Copy Files 24 | 2. Create Folder 25 | 3. Delete File 26 | 4. Delete Folder 27 | 5. Move File 28 | 6. Move Folder 29 | 7. Create Text File 30 | 8. Open Text File and Write Lines 31 | 9. Read Files in MSG Box 32 | 10. Attributes Files & Folder 33 | 11. Change File Attributes 34 | 12. Get File Size 35 | 13. Read Sub Folder in Folder 36 | 14. Get Drive Letter 37 | 15. Custom MSG Box 38 | 16. View User Pic Location 39 | 17. Execute Program 40 | 18. Run Program 41 | 19. Get Process Id and Status 42 | 20. Notification for Closing Program 43 | 21. Open & Close Program Automatically 44 | 22. Ping & Back Status 45 | 23. Open Notepad & Send Keystrokes 46 | 24. Get Program File Locations 47 | 25. Get User Desktop Location 48 | 26. Create Shortcuts on Specific Location 49 | 27. Create web URL 50 | 28. Print Reverse String 51 | 52 | ``` 53 | 54 | ### Prerequisites 55 | 56 | What things you need to install the software and how to Execute them 57 | 58 | 1. Windows System 59 | 2. Notepad 60 | 61 | ### Installing 62 | 63 | 1. Download Repo. 64 | 2. Extract to Folder 65 | 3. Open Execute .Vbs Files. 66 | 67 | ## Built With 68 | 69 | Visual Basic Scripts 70 | 71 | ## Version 72 | 73 | 1.0 74 | 75 | ## Authors 76 | 77 | Ajay Randhawa 78 | --------------------------------------------------------------------------------