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 8978373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:35:46+00:00 2026-06-15T19:35:46+00:00

When I use a batch file to create the file invisible.vbs , then delete,

  • 0

When I use a batch file to create the file invisible.vbs, then delete, it stops with an error. Basically, what I want to do is to have the batch file make this file.

This is the error that I get when I run the batch file:

C:\Users\HP\Desktop>"New Text Document.bat"
 CreateObject("Wscript.Shell").Run """"
'WScript.Arguments' is not recognized as an internal or external command, operable program or batch file.
'""""' is not recognized as an internal or external command, operable program or batch file.

This is what’s in the batch file:

@ECHO OFF  
CD /D %~dp0  
ECHO\ CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0,False>>Invisible.vbs  
::What I want to do with the file is here  
DEL %CD%\invisible.vbs /Q /S

I notice that the file is generated, but it is empty, and therefore does nothing when I try to use it to make another batch file invisible.

  • 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-15T19:35:48+00:00Added an answer on June 15, 2026 at 7:35 pm

    This is caused by the & symbol in your echo statement. It needs to be escaped by the batch escape character ^ when using it literally ^&. You may also want to use the single output redirection operator > (overwrite existing) instead of the double >> (append to existing).

    @ECHO OFF
    CD /D %~dp0
    ECHO.CreateObject^("Wscript.Shell"^).Run """" ^& WScript.Arguments^(0^) ^& """", 0,False>Invisible.vbs
    ::What I want to do with the file is here  
    DEL %CD%\invisible.vbs /Q /S
    

    Another tip would be to use the %TEMP% directory variable when creating throw away files.

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

Sidebar

Related Questions

I have a program I use to create a batch file. My problem is
I have a batch file that creates a scheduled task using schtasks like this:
I want to create a batch file that builds several Visual Studio 2010 projects.
I want to create a batch file which only continues if MASTERRESET.DLL consists of
I want to create a batch file, batch.bat , that accepts 2 mandatory arguments:
I'm wanting to create a batch file that will back up my computer. This
I'm trying to use a batch file to create another batch file... it's a
I want to create a Postgres database using a batch file. Now the normal
I want to create a variable in a batch file and I want to
I would like to use batch file to insert a string to replace the

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.