Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:39:53+00:00 2026-06-08T13:39:53+00:00

I have a VBScript file which I am trying to call from a Batch

  • 0

I have a VBScript file which I am trying to call from a Batch file. The following code I coped to a notepad and saved as MyScript.vbs

(http://gallery.technet.microsoft.com/scriptcenter/8bbed56f-a7aa-491f-a296-687dd96098a3#content)

    Const HIDDEN_WINDOW = 12 

    strComputer = "." 
    Set objWMIService = GetObject("winmgmts:" _ 
               & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
    Set objStartup = objWMIService.Get("Win32_ProcessStartup") 

    Set objConfig = objStartup.SpawnInstance_ 
    objConfig.ShowWindow = HIDDEN_WINDOW 
    Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process") 
    errReturn = objProcess.Create("Notepad.exe", null, objConfig, intProcessID) 

Created a batch file named Run.bat and added the below code in it.

    @echo off

    start "C:\\Users\\guest\\Desktop\\123\\MyScript.vbs"

When I try to execute the batch file through the command prompt, which opening another command prompt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:39:55+00:00Added an answer on June 8, 2026 at 1:39 pm
    rem This is the command line version
    cscript "C:\Users\guest\Desktop\123\MyScript.vbs"
    

    OR

    rem This is the windowed version
    wscript "C:\Users\guest\Desktop\123\MyScript.vbs"
    

    You can also add the option //e:vbscript to make sure the scripting engine will recognize your script as a vbscript.

    Windows/DOS batch files doesn’t require escaping \ like *nix.

    You can still use "C:\Users\guest\Desktop\123\MyScript.vbs", but this requires the user has *.vbs associated to wscript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a batch file where in I call a VBScript(which returns the
I have a vb script (say myScript.vbs) which is used to monitor a file
I have a batch file that calls a vbscript file. I am trying to
I have a VBScript script file saved as a .vbs on my desktop: pastebin.com/Nhj5Rs0j
I have a VBScript file which makes a GET request to a URL: Dim
I have a VBScript code snippet which converts my xls and xlsx files into
I'm running a simple batch file which is generated by a vbscript to delete
Context: Windows7, VBScript, ADODB and ADOX. I have written some VBScript code which creates
I have a vbscript file A that will call another vbscript file B. File
I have a vbscript which does the following: Open an access 2003 database Run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.