How to Run Vbscript Command from Cmd

(I don't speak English. Hope you understand.)

Hi, I have the following VBS command.

set shell = CreateObject("Wscript.Shell") : shell.run "notepad"

(Start notepad, but from vbs.) I want to run this command from CMD. I can't do it like:

C:\>wscript set shell = CreateObject("Wscript.Shell") : shell.run "notepad"

I can do:

C:\>wscript script.vbs

but I must have the command in another file. I want to run it from the command prompt. How could I do it?

Thank you for the answers, Andrew

2
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article