Jump to content

Recommended Posts


Posted (edited)

There are a couple of different ways to do it

1:\ cmdow.exe

This needs to be in either \Windows\System32 or the same dir as the batch file.

Then at the top of the batch file you need to have this

cmdow @ /HID
@echo off

2:\ VBS method

You can use a vbs script to hide the cmd window.

This script runs Cmd promt 3 times

The First Time it a Dir cmd

The Second is it adds your name to the text file

The Third is it adds your computer name to the text file

It then open the text file, then deletes the text file

Save As HideCmdWindow.vbs

Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Cmd1, Cmd2, Cmd3, Txt
Txt = "DirectoryList.Txt"
Cmd1 = "%Comspec% /C " & vbCrLf & "Dir /b /a > " & Txt
Cmd2 = "%Comspec% /C " & vbCrLf & "Echo User Name : %UserName% >> " & Txt
Cmd3 = "%Comspec% /C " & vbCrLf & "Echo Computer Name : %ComputerName% >> " & Txt
Act.Run(Cmd1),0, True
Act.Run(Cmd2),0, True
Act.Run(Cmd3),0, True
Act.Run(chr(34) & Txt & Chr(34)),1,True
Fso.DeleteFile(Txt), True

Edited by gunsmokingman

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...