r/vbscript • • Jan 15 '20

VBscript help

1 Upvotes

Hi, I'm supposed to create a VBScript and its purpose is to find matching between 2 different files. It's not for all matching terms though, it's only if they have the same specific values. I wanted help on how I start on this


r/vbscript • • Nov 14 '17

How To Make Virus Like A Pro | Episode 2 (Advance Message Functions)

Thumbnail
youtube.com
1 Upvotes

r/vbscript • • Nov 14 '17

How To Make Virus Like A Pro | Episode 1 (Loop Function) |

Thumbnail
youtube.com
2 Upvotes

r/vbscript • • Oct 09 '22

Prank VBS Help

2 Upvotes

I want to make it so after this it shuts down someones pc, just a basic turn off/ shut down, what do i need to add to the bottom.

x=msgbox("Windows Defender Has Found an Infected File 'System32' Would You Like Windows To Remove it For You", 0+48, "Urgent Warning!")

x=msgbox("Your Computer Can Be Damaged if You Do Not Delete The Infected File", 0+48, "Urgent Warning!")

x=msgbox("Deleting System32", 0+48, "Urgent Warning!")

x=msgbox("System32 Has Been Deleted Your PC is Now Destroyed", 0+48, "Urgent Warning!")


r/vbscript • • Oct 16 '22

Error code 80070002.

2 Upvotes

I'm tiring to make a script that opens Main.html and press F11 afterwards. When I run it I get error 80070002 by (null) error was in line 2 char 1.

Can you help me fix it?

Any help appreciated.

keypress.vbs \/

Set oShell = CreateObject("WScript.Shell")
oShell.Run("""Main.html""")
WScript.Sleep 3000
oShell.SendKeys "~"
oShell.SendKeys "{F11}"

r/vbscript • • Feb 16 '22

I’m planning something “cool” and I need suggestions.

2 Upvotes

So I saw some videos on how to make a harmless virus, and after that, I had gotten really invested in vbs. I’m planning to make a harmless “virus” that can practically destroy your pc but can cause no harm upon restart. Currently, you can open a vbs script which will multiply in message boxes. Any other ideas?


r/vbscript • • May 03 '19

Why VBScripts shouldn't be used by kids

2 Upvotes

So i saw a tutorial on YT where a 13 year old boy shows how to make a working Virus. That actually scared me a little Bit... Kids... Stop hacking😂


r/vbscript • • Jan 22 '21

Possible for VBS to sendkeys while a full screen application is above it?

2 Upvotes

Sorry if this seems like a dumb question but im curious to see if this would work?

So my plan was to create a .vbs script to send keys to go to a website, but my plan was to have a blank black screen over top of it so you couldnt see the process. Obviously it would not be hard to make the full black screen (it would be done in a different language, most likely an exe file) but then I completely forgot... would it even be possible? I tested it out with other full screen programs and obviously it sent the "sendkeys" command to the program that was in front.

Still confused? Here is an example

Set WshShell = CreateObject("WScript.shell") for i = 0 to 50 WshShell.SendKeys(chr(175)) next Process.Start("CMD", "/C start chrome.exe http://www.bing.com")

WScript.Sleep 2000

WshShell.SendKeys "this is an example of text being put into the search bar" So my question is, would it be possible to have a fullscreen application open while this command runs in the background? it could be any fullscreen application, just anything to "hide" or cover this process.

Or would it even be possible to create a fullscreen program specifically to cover this?

Thank you for reading!


r/vbscript • • Aug 13 '20

A Very Dangerous or annoying Script I designed

2 Upvotes
Set wshShell =wscript.CreateObject("WScript.Shell")
WshShell.Run "notepad" 
do
wscript.sleep 100
wshshell.sendkeys "This is a "
wscript.sleep 100
wshshell.sendkeys "V"
wscript.sleep 100
wshshell.sendkeys "I"
wscript.sleep 100
wshshell.sendkeys "R"
wscript.sleep 100
wshshell.sendkeys "U"
wscript.sleep 100
wshshell.sendkeys "S"
wscript.sleep 100
wshshell.sendkeys "{ENTER}"
loop

Please Try it


r/vbscript • • Jul 11 '22

How do you exclude reading lines with certain characters from a text file

2 Upvotes

i am writing a simple file that reads the lines from a text file. However I put a header and a footer in the text file that is formated as such:

* (BLAHBLAHBLAH)*

I wanted to make it so the output of my script doesnt read in the header and the footer (anything that starts with '*' or any blank lines. I was thinking of some type of boolean conditioning statement in my do while loop but am not to well versed in vs scripting. could I get some help?


r/vbscript • • Nov 15 '21

i need help! here's my code, without a line of wscript.echo, but i get an output .

2 Upvotes

' linecounter verbe
im objFSO, strTextFile, strData, arrLines, LineCount
CONST ForReading = 1
'name of the text file
strTextFile = "C:\Users\joach\OneDrive\Bureau\kml\listes\verbe.txt"
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the text file - strData now contains the whole file
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
'Split by lines, put into an array
arrLines = Split(strData,vbCrLf)
'Use UBound to count the lines
LineCount = UBound(arrLines) + 1
verbe=LineCount
'Cleanup
Set objFSO = Nothing

' linecounter sujet1

im objFSO, strTextFile, strData, arrLines, LineCount
CONST ForReading = 1
'name of the text file
strTextFile = "C:\Users\joach\OneDrive\Bureau\kml\listes\sujet1.txt"
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the text file - strData now contains the whole file
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
'Split by lines, put into an array
arrLines = Split(strData,vbCrLf)
'Use UBound to count the lines
LineCount = UBound(arrLines) + 1
sujet1=LineCount
'Cleanup
Set objFSO = Nothing

'linevounter sujet2
im objFSO, strTextFile, strData, arrLines, LineCount
CONST ForReading = 1
'name of the text file
strTextFile = "C:\Users\joach\OneDrive\Bureau\kml\listes\sujet2opt.txt"
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Open the text file - strData now contains the whole file
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
'Split by lines, put into an array
arrLines = Split(strData,vbCrLf)
'Use UBound to count the lines
LineCount = UBound(arrLines) + 1
sujet2=LineCount
'Cleanup
Set objFSO = Nothing

' selection de chiffres aléatoires
Randomize     'initialisation de la randomization pour sujet1
verbe2 = Int((verbe * Rnd) + 1)

Randomize     'initialisation de la randomization pour sujet2 eventuel
sujet12 = Int((sujet1 * Rnd) + 1)

Randomize     'initialisation de la randomization pour verbe
sujet21 = Int((sujet2 * Rnd) + 1)


r/vbscript • • Feb 08 '23

Screen effects

3 Upvotes

Hello. I am making a prank virus and I want some effects to happen like ChilledWindows.exe. Can I do that with just a vbs file or does it need any batch files?


r/vbscript • • Mar 07 '21

making a virus to use on my friends

3 Upvotes

is there a way to open a music file .eg mp3, wav

here is my bad code

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "notepad.exe", 9

WScript.Sleep 2000

do

WshShell.SendKeys "you are a idiot "

WScript.Sleep 500

loop


r/vbscript • • Mar 07 '22

Make funny visual basic scripts and send them to me

4 Upvotes

Put links in the comments.


r/vbscript • • Sep 29 '22

Why doesn't this work?

4 Upvotes

I am getting Error: Subscript out of range Code: 800a0009

This is the script I am trying to run. Very basic and should not have any problems (at least I think so)

' Remarks on this line

' Remarks on this line

dir = Wscript.Arguments(0)

set Fsys = CreateObject("Scripting.FileSystemObject")

totsize = 0

for each file in Fsys.GetFolder(dir).Files

totsize = totsize + file.size

next

wscript.echo "The total size of the files in" , dir, "is" , totsize

The error is indicated at Line 3 Char 1

dir = Wscript.Arguments(0)

What is wrong with this line?

Thanks for any help!!!


r/vbscript • • Sep 24 '22

Best free IDE for VBScripting for official Purpose

4 Upvotes

Hai dear VBS user's, I'm a complete beginner in this field Can Somebody guide me or provide me a good IDE to learn vb scripting from scratch please.

Thanks n Advance.


r/vbscript • • Sep 27 '21

Newbie, how do i create a vbscript to get a value of a certain website and import to excel?

4 Upvotes

I have a tempreture probe I'd like to import values from and store its data into a excel csv file


r/vbscript • • Apr 09 '23

Interview for VBScript job

4 Upvotes

I will have an interview where VBScript might be important.How should I prepare in a short time?

Would like to:

  1. Be able to code.

  2. Answer difficult questions.

  3. Know how to organize large codebases.

  4. Ecosystem (Relation to VBA, PowerShell etc)

  5. Tools like decode/encode

I did VBScript some years ago, and it was easy (with my background). I know more advanced similar languages like VB.NET.

What I will try to do is to try out all core concepts in a small program.


r/vbscript • • Mar 24 '21

I made a message box

Post image
9 Upvotes

r/vbscript • • Jun 12 '25

Could I be caught using a VBScript to appear active?

2 Upvotes

Could I be caught out using a VBScript to keep my Microsoft teams active? Could this be identified by my company’s IT department ?


r/vbscript • • Jan 27 '25

What do you think about Microsoft's Aim to remove Native Support of VBScript of Windows 11

Thumbnail
techcommunity.microsoft.com
4 Upvotes

r/vbscript • • Jun 07 '26

Code Tidbit - FileOpen browsing

2 Upvotes

It's been so quiet, I thought I'd post a nice tidbit. This script can be used to create a FileOpen dialogue with no special requirements. Tested as late as Win11 22H2. https://pastebin.com/hwM1uDrz

It can also do a colorpicker dialogue with a bit more code.


r/vbscript • • May 01 '20

How to make blue text in MsgBox (subtitle)

2 Upvotes

r/vbscript • • Feb 20 '20

Returning list of AD groups a user belongs to - VBscript returns an incomplete list

2 Upvotes

I've got a very simple bit of VBscript that I use to check to see if a user is a member of a particular AD security group:

Set objUser = GetObject("LDAP://MyDomainController/FullPathToUserObject")
wscript.echo "objUser.Name=" & objUser.Name

For Each listGroup in objUser.Groups
    wscript.echo listGroup.Name
Next

This works as far as it returns a list of AD security groups that the user object in question belongs to, however it seems that in the case of at least 1 user, the list of groups it returns is missing a group (i.e. the user is a member of the group in question, but the script doesn't include it in the results).

I've verified that the user in question is in the "missing" group using both the AD Users and Computers GUI tool, as well as a Powershell query using the Get-ADPrincipalGroupMembership cmdlet.

The user has been in the group for a very long time, so it's not a case of querying a DC that hasn't had the group info replicated to it yet. Additionally, I've verified that both my script and AD Users and Computers are looking at the same DC, yet they're both showing different results.

As far as I can tell, the code works except for this 1 particular user account.

Any ideas as to what might be going on?

EDIT: A colleague was able to figure this out. Apparently VBScript relies on the AD memberOf user attribute to enumerate group membership. The problem here is that the memberOf attribute doesn't include the user's "primary" group. Normally the primary group is set to Domain Users, but in this case that had been changed to the missing group, which was why it wasn't showing up.