r/vbscript

768 archived posts · Oct 2010 – Sep 2026

Random post

u/hackoofr•

Description of this vbscript : Youtube2MP3_Player.vbs is written for playing mp3 songs extracted from youtube videos in background.

 ' Description of this vbscript : Playing mp3 songs extracted from youtube videos in background
 ' Description en Français : Lecture de chansons mp3 extraites de vidéos youtube en arrière-plan
 '------------------------------------- Links Examples -----------------------------------------
 ' "https://www.youtube.com/watch?v=HDsCeC6f0zc" ===> The KLF - 3AM Eternal
 ' "https://youtu.be/dQw4w9WgXcQ"                ===> Rick Astley - Never Gonna Give You Up
 ' "https://youtu.be/cvvd-9azD1M"      
102


u/hackoofr•

Just i want to share with you this vbscript that i made on 24/03/2021 for fun :

Description :

This vbscript can play "Never Gonna Give You Up" ,From the Autor : "Rick Astley" in the background

And can open in the same time the Notepad and Auto type "Never Gonna Give You Up Lyrics"

Rick_Roll.vbs

81


u/bvttfvcker•

Hello all,

(This is the part where I tell you my life's story and share my love for rustic art, autumn leaves, old barns, etc.. Please feel free to skip to problem statement and code)

I thank you all for your time here. This is my second time ever writing .VBS, my first being to open cmd and using send.keys to spam commands to accomplish things like loading binaries and changing filenames over FTP.

*Problem Statement*

My script works as follows at home: This script finds a location and event (X, Y, (event)) from a mousecords.csv and moves the mouse to that location, and based on the (event) tag either clicks, double-clicks, copy, paste, or inserts text looped from a different .csv call

62

u/hackoofr•

I made before a vbscript that can play in background a list of youtube videos as mp3 that can be modified inside an array in the same code.

So, someone ask me if he could just choose to download this video as mp4 or mp3

Description of the new script :

  • The user can copy and paste the Youtube link on InputBox.
  • The vbscript Ask him with a MsgBox if he wants to download the converted video as :
  1. MP4 Click on YES Button
  2. MP3 Click on NO Button
  3. Click on Cancel Button to listen it in Background
  • [YouTube_To_MP4_MP3_Player_Downloader
60

I came across vbscript because of a software which would record my actions in a VBscript code. Then by modifying such code I could optimize and automize processes done in such software.

Then I found out that I could write any type of vbscript to automize file system operations and run it simply from the file explorer. For example, I recently created a script that would rename PDFs in a folder given some data from a selected Excel workbook, and I could just share it with my colleagues so that they could also run it on their end.

However, I keep reading that VBscript is obsolete and other scripting languages like Python or C# are much better. Is it really like so? Vbscript doesn’t require

63

u/Kaiyora•

Trying to get intellisense for the Word, Excel, Powerpoint object libraries etc in VScode but can't figure out how to get it working. Anyone have any idea? Looks like none of the VScode extensions I see have any option to add the office object libraries but I'm not totally sure.

53

u/devalolav•

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.

​

​

​

​

53

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!!!

54

u/horaison_kik•

Guys please help, I'm not a programmer. But I need to write a script where I can load multiple text files in order. So far I have managed to load multiple text files and make a plot in diadem with it. But the problem is i can't get it to load in an order.

57

u/JGN1722•

Hello everyone ! I need help because I can't figure out how to put vbscript code into an html page.

What I'd like to do is a page with a button on it, and when this button is clicked, it activates a script that either modifies the inner html of the current page, or creates another html page on which I can write what I want.

I've tried to do the second option by writing a code that creates a new instance of the internetexplorer.application object, and then writes something in it's html, but sadly it doesn't work

Could someone help me, or send the link to a website that explains how to do that ? I have no experience of using vbscript along with html

510