---
title: "运行bat文件时不弹出CMD窗口的方法"
author: "josh198331"
date: "2013-05-08T17:18:29Z"
tags: []
categories: ["编程语言"]
slug: "bat-cmd"
draft: false
lastmod: "2013-05-08T17:18:29Z"
id: 1864425
url: "https://josh198331.iteye.com/blog/1864425"
---

在网上找的，有错不要怪我，因为我不懂vbs

 

1、单次运行请用这个，修改auto.bat为你要运行的批处理文件的名字，并将以下内容保存为vbs格式，放到auto.bat文件所在目录，名字随便，例如run.vbs

 

Set shell = Wscript.createobject("wscript.shell")

a = shell.run ("auto.bat",0)

 

2、循环运行请用这个，示例为每60秒运行一次，保存格式和所放置的目录同1所述

 

dim a

set a=CreateObject("Wscript.Shell")

Do

a.run "auto.bat"

Wscript.Sleep 60000

Loop

 

参考文章：

 

http://tieba.baidu.com/f?kz=298805494

 

http://hi.baidu.com/goodzhj/blog/item/2f52878baf8239d3fc1f1020.html