Solved

how to suppress command prompt window or command itself, started from .bat file?

Posted on 2004-09-09
6
4,683 Views
Last Modified: 2012-06-22
I am using this in a .bat file:
"C:\Program Files\VC\VC2Agent.exe " user, pass

When executing, the command prompt window displays this line. Unfortunately, this line contains username and password. Is there a way either to suppress the command prompt window entirely, or suppress the "C:..." line, OR at the very least, close up or minimize the command prompt window as soon as the program starts execution?

Thank you in advance for your responses.
Phil
0
Comment
Question by:spoowiz
6 Comments
 
LVL 57

Expert Comment

by:Pete Long
ID: 12019664
is that an antivirus agent?

does the .exe come with a /SILENT switch?
0
 

Author Comment

by:spoowiz
ID: 12019707
it's a program i wrote using VB.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 12019716
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 86

Expert Comment

by:jkr
ID: 12019729
From a .bat file, try

start /min "C:\Program Files\VC\VC2Agent.exe " user, pass

0
 
LVL 11

Accepted Solution

by:
jgiordano earned 125 total points
ID: 12019741
INFO on THE START COMMAND with /MIN option:

 Try the start command you can use low priority and run minimized:

Home NT Commands
     
     
     
NT Syntax

START

Start a specified program or command in a separate window.

syntax
      START "title" [/Dpath] [options] [command] [parameters]

key
   WHAT to run

   path       : Starting directory
   command    : The NT Command, Batch file or executable program to run
   parameters : The parameters passed to the command

   HOW to run it

   /MIN       : Minimized
   /MAX       : Maximized
   /WAIT      : Start application and wait for it to terminate
   /LOW       : Use IDLE priority class
   /NORMAL    : Use NORMAL priority class
   /HIGH      : Use HIGH priority class
   /REALTIME  : Use REALTIME priority class
   "title"    : Text for the CMD window title.
   /B         : Start application without creating a new window. In this case
                ^C will be ignored - leaving ^Break as the only way to
                interrupt the application
   /I         : Ignore any changes to the current environment.

   Options for 16-bit WINDOWS programs only

   /SEPARATE   Start in separate memory space (more robust)
   /SHARED     Start in shared memory space (default)

Bugs:
Although ["title"] is supposedly an optional parameter, when it is omitted other options may be interpreted as being the title - so to be absolutely sure just put something in like "My Script".

Documents
Document files may be invoked through their file association just by typing the name of the file as a command.
e.g. START WORD.DOC would launch the application associated with the .DOC file extension

Printers
A new printer can be installed very quickly (and the driver downloaded) with the command
START \\print_server\printer_name

Setting a Working Directory
To start an application and specify where files will be saved

START /Dc:\Documents\ /MAX notepad.exe

Note that START /D does not support long filenames which contain spaces, a workaround is to use the 8.3 compatible name(s)

Forcing a Sequence of Programs
If you require your users to run a sequence of 32 bit GUI programs to complete a task, create a batch file that uses the start command:

@echo off
start /wait /b <First.exe>
start /wait /b <Second.exe>
start /wait /b <Third.exe>

Create a shortcut to this batch file and place it on the Start menu or desktop. Set it to run minimized.
When the user double-clicks the shortcut, <First.exe> runs.
When <First.exe> terminates, <Second.exe> runs
When <Second.exe> terminates, <Third.exe> runs

An alternative method is to run a .BAT batch file under command.com (16 bit)

If Command Extensions are disabled, the START command will no longer recognise file Associations, and will not automatically evaluate the COMSPEC variable when starting a second CMD session.

Missing file extensions
When executing a command line whose first token does NOT contain an extension, then CMD.EXE uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. The default value for the PATHEXT variable is:

.COM;.EXE;.BAT;.CMD

Notice the syntax is the same as the PATH variable, with semicolons separating the different elements.

When executing a command, if there is no match on any extension, then NT will look to see if the name, without any extension, matches a directory name and if it does, the START command will launch Explorer on that path.

"Do not run; scorn running with thy heels" - Shakespear, The Merchant of Venice

Related commands:

CALL - Call one batch program from another
CMD - can be used to call a subsequent batch and ALWAYS return even if errors occur.
GOTO - jump to a label or GOTO :eof

Q162059 - Opening Office documents

Equivalent Linux BASH commands:

.period - Run commands from a file

[Back to the Top]

Simon Sheppard
0
 

Author Comment

by:spoowiz
ID: 12019756
jkr - tried it. it says "Cannot find the file 'user, pass' (or one of its components)..."
so the syntax is off, i think.
jgiordano - i will read it.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Process prvSGxBA.exe 100 % CPU, is this a virus? 7 67
partition magic 8 extend into d drive 7 68
Windows print sharing 1 70
MS-Access 2002 error (Win XP on Win7Pro) 19 67
cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question