Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

silent batch file (no dos window)

$
0
0

Hello All,

I'm a newbie...

I have found this code in a forum (claiming it would make the .cmd or a .bat run invisible) But I don't how to make it work!!!

Where do I paste this code? in the batch file? beginning? end? what about the reference to "main.bat" do I replace that with the name of my batch file? Thanks in advc!

"---
Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN("c:\main.bat", 0, True)
Set WshShell = Nothing"

Basically all I'm trying to do is silently execute a batch file to delete a specific file.

This is the content of my batch file:

ECHO OFF
Start /d "C:\" DEL aa.txt

Simple isn't it! It deletes the file BUT always opens a DOS prompt and I I have to close it manually :(

I've tried adding EXIT at the end of my batch file, but to no avail..I'm running this on WinXP

Thanks again for your help!



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>