Solved

batch file creation

Posted on 2009-04-14
35
1,181 Views
Last Modified: 2013-11-09
Hi all,
Probably a very noob question, but I am trying to create a batch file to run an executable, which I can do however the executable prompts for a y or n command to continue.  What is the switch I need to put into the batch file to give a y confirmation?

Thanks in advanced!!!
0
Comment
Question by:m1ndg4m3
  • 15
  • 10
  • 6
  • +2
35 Comments
 
LVL 16

Expert Comment

by:t0t0
ID: 24136240
Please answer: What is the line in your batch file which runs your executable?


Typical command options are:

   echo y | COMMAND

where COMMAND is your executable
0
 
LVL 6

Expert Comment

by:Robmonster
ID: 24136267
Hello m1ndg4m3,

Soemtimes you can create a file called y.txt for example, containing the singe y character and then have the following in your batch file:-

executable.exe < y.txt

We really need to know a little more about the program you are trying to run.

Regards,

Robmonster
0
 

Author Comment

by:m1ndg4m3
ID: 24136280
Thanks guys.  The executable is c:\fsaua-reset.exe it is basically a virus definition clean up utility, it asks for the y or n prompt as soon as it starts.

Regards
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 6

Expert Comment

by:Robmonster
ID: 24136309
t0t0 is correct. Similar problem discussed by MS here:-

http://support.microsoft.com/kb/135268
0
 

Author Comment

by:m1ndg4m3
ID: 24136446
ok, I have tried the different commends on the kb article however the exe still seems to sit at the prompt.

would the following be correct?

Cacls c:\fsaua-reset.exe /g administrator:R < c:\yes.txt

or

echo y| cacls c:\fsaua-fsreset.exe  /g administrator:R

Regards

0
 
LVL 6

Expert Comment

by:Robmonster
ID: 24136481
Don't include calcs, that's just the example given at the MS site, trying to solve the same problem.

Try:-

echo y | c:\fsaua-fsreset.exe /g administrator:R
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24136627
Does fsaua-reset.exe itself not include a command line option to suppress the need to enter Y or N?

0
 
LVL 16

Expert Comment

by:t0t0
ID: 24136672
You should try either:

   echo y | c:\fsaua-fsreset.exe  /g administrator:R

or

   fsaua-reset.exe /g administrator:R <c:\yes.txt

yes.txt should contain a single 'y' followed immediately by a carriage-return character and a linefeed character.

To create yes.txt, at a DOS command prompt line type:

   copy con yes.txt

then press the 'y' key
then press the carriage-return key (aka the ENTER key)
then press CTRL-Z keys-combination (press and hold down the CTRL key while pressing the 'Z' key)


   
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24136704
Oops!!

You should try either:

   echo y| c:\fsaua-fsreset.exe  /g administrator:R

or

   c:\fsaua-reset.exe /g administrator:R <c:\yes.txt

yes.txt should contain a single 'y' followed immediately by a carriage-return character and a linefeed character.

To create yes.txt, at a DOS command prompt line type:

   copy con yes.txt

then press the 'y' key
then press the carriage-return key (aka the ENTER key)
then press CTRL-Z keys-combination (press and hold down the CTRL key while pressing the 'Z' key)

0
 
LVL 16

Expert Comment

by:t0t0
ID: 24136723
Oh, and don't forget to press the carriage-return key (aka the ENTER key) at the end of your CTRL-Z
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24136851
Thank you robmonster for your help
0
 

Author Comment

by:m1ndg4m3
ID: 24137609
Sorry guys no joy
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 24138080
Do not think it makes any difference, but the    /g administrator:R    part is certainly taken from the MS example, it is a cacls option ...
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24138156
Good point. Have you tried just....

   echo y| fsaua-fsreset

or just

   fsaua-reset<yes.txt
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24138886


Are you sure that is the executable's name?
A google search on "fsaua-fsreset.exe" comes up with nothing, however a search on "fsaua.exe" comes up with a variety of instances that give the program directory as:

C:\Program Files\F-Secure Internet Security\FSAUA\program\fsaua.exe
C:\Program Files\Shaw Secure\FSAUA\program\fsaua.exe
C:\Program Files\Embarq Online Security 8\FSAUA\program\fsaua.exe
C:\Program Files\Orange\AntivirusFirewall\FSAUA\program\fsaua.exe
C:\Program Files\Charter Security Suite\FSAUA\program\fsaua.exe
C:\Program Files\COGECO Security Services\FSAUA\program\fsaua.exe
C:\Program Files\TalkTalk Online Security\FSAUA\program\fsaua.exe

It seems clear that it is an F-Secure product you have, but they probably  licence it out to some other software suites, utilities, or online scanning services.

An acronym for : "F-Secure Automatic Update Agent" perhaps?

Are you sure that "fsreset" is not a command line switch that you can use with the "fsaua.exe" command like this?:

fsaua.exe -fsreset
OR
fsaua.exe /fsreset

Could you please do something for us. Open a new Command Window and type in the following separate commands:

cd \
fsaua /?

If that doesn't work, then try different permutations of the "help" switch like /h  /help  -?  -h  -help  --?  --h  --help

It's practically impossible to avoid all the uploaded HiJack This reports when I try to search for "fsaua.exe command line options", because the HiJack This reports have a footer that quotes "command line options", and this is the sort of relevant content that it finds:

O23 - Service: F-Secure Automatic Update Agent (FSAUA) - F-Secure Corporation - C:\Program Files\Charter High-Speed Security Suite\FSAUA\program\fsaua.exe

In HiJack This log files, "023" is a "Service".
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24138950
BillDL
Nice detective work.... I could not find anything under the given exe name either. I'm inclined to think you're right on your assumptions.

Unless the exe has been renamed.
0
 

Author Comment

by:m1ndg4m3
ID: 24138984
Thanks for your efforts, although that is definately the exe name.  It is a virus definition cleanup utility sent to me by f-secure, I can attach it as a zip file if you are willing to trust that it is virus free.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139020
Go on then....
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139069
In one of your earlier comments, you said:
"The executable is c:\fsaua-reset.exe it is basically a virus definition clean up utility".

Ignoring the possibility that you may have the actual executable name rolled in with a command line switch, when you say "virus definition cleanup utility" do you mean that it cleans up viruses, or cleans up the definition files used by (an) anti-virus program?

If you are trying to get rid of viruses, then from what I have found in cached copies of the F-Secure product Release Notes, the Command Line program is "fsav.exe".  Going back to my earlier searches for fsaua.exe, I see that "fsav.exe" should be found in the "AntiVirus" folder
C:\Program Files\Shaw Secure\Anti-Virus\fsav32.exe
where the fsaua.exe program is in its own "FSAUA" folder.
C:\Program Files\Shaw Secure\FSAUA\program\fsaua.exe

Here's an extract from one of the F-Secure Release Notes I found with regard to command line scanning:

>>>>>>>>>>>>>>>>>>>>>>>>>>
Command-line scanner and scheduled scanning tasks may find more spyware than scanning tasks executed from user interface [55119]

In some cases, the command-line scanner and scheduled scans may find more spyware than manual scanning task executed from user interface (UI).  These two scanning methods are related because the scheduled scanning tasks actually use the command-line scanner (fsav.exe).  There are a couple of reasons for this:

The command-line scanner runs the scans with a slightly different scanning engines configuration.

The scheduled scans run under a different user account (Local System, as opposed to the currently logged on user account used for UI-started scanning tasks).  The Local System account has access to some folders where the user does not have access, like the System Restore folder.

These differences are minor and not significant from the system's security point of view.  UI-started tasks will be able to find spyware that pose a security threat in any case.  Examples of the minor spyware detection differences are:

The command-line scanner can find tracking cookies that are not active but have been copied from the cookies folder to some other folder by the user.

The scheduled scans can find previously deleted malware items from the System Restore folder.
<<<<<<<<<<<<<<<<<<<<<<<<<<
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139087
Yes please, could you zip it up and upload it for us to see.  You will have to rename it by changing the .exe extension to .txt before zipping it, because the site won't allow uploads of *.exe files, even inside zip files.
0
 

Author Comment

by:m1ndg4m3
ID: 24139130
Ok the file is attached, it is only small however I have zipped it anyway.

Thanks
fsaua-reset.zip
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139163
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139186
use the -s option
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139205
Use:

   c:\fsaua-fsreset.exe  -s

to suppress prompting
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139232
Thanks for that, we can test it out with some switches and see what happens.

fsaua-reset -? > Fsaua_Reset_Usage.txt

F-Secure Automatic Update Agent - Reset Tool (8.22 build 2011)
Copyright (c) F-Secure Corporation 2007. All rights reserved.

-? for help

This tool will re-initialize F-Secure Automatic Update Agent and Server versions 6.00 and later.

fsaua-reset [-options]
 [options]
   -s       silent, do not ask to confirm
   -v       verbose mode

So, the switch you are looking for is the -S
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139243
Aaaah, you're so quick t0t0.  2 minutes too quick :-)
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139259
BillDL

The file is compressed and renamed as txt. Uncompress the file and rename it to an exe. The help switch is -?. There are basically two command line options -s and -v (silent mode and verbose mode). The -s option does not ask for confirmation.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139260
Isn't it your dinner time t0t0?  That way I can play without fear of being beaten to the answer ;-)
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139266
So are you....
0
 
LVL 38

Accepted Solution

by:
BillDL earned 250 total points
ID: 24139284
Hee, hee.  I'm off to eat.  catch you later.

m1ndg4m3
Give that a blast.  I hope it works for you.

0
 
LVL 16

Assisted Solution

by:t0t0
t0t0 earned 250 total points
ID: 24139293
Don't worry about beating me to the answer BillDL.... Once we've cracked this nut we'll kindly ask m1ndg4m3 to split the points amongst us - I'm sure he'll only be too happy to.

Oops!!! It's just passed my dinner time......
0
 

Author Closing Comment

by:m1ndg4m3
ID: 31569817
That cracked it! thanks very much to all who helped I really appreciate it,  I have split the points so I hope everyone is happy with that.
Best Regards
m1ndg4m3
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139430
Not yet, I just had another thought about the issue of "prompts".

m1ndg4m3
If you were emailed this file, or if you downloaded it, to an XP system, then it is probable that it will have metadata in it that identifies it as an unknown source and will always issue you with a security prompt unless you "trust" it.

I have attached a screenshot of the security warning you will get when you run the program if it hasn't been unblocked.  You can untick the box and it won't prompt again.  Alternatively, Right-Click on the *.exe file and choose "Properties".  Click the "Unblock" button and the "Apply" button will become available.
Open-File-Security-Warning.jpg
Unblock-Button.jpg
0
 
LVL 38

Expert Comment

by:BillDL
ID: 24139451
Whoops, I second-guessed another possibility prematurely.  That's great.  Now I'm off to eat.  Thank you m1ndg4m3.
0
 
LVL 16

Expert Comment

by:t0t0
ID: 24139522
Blimey BillDL.... You're gonna have to reheat your Pot Noodle.

0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

821 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