batch file creation

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!!!
m1ndg4m3Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
BillDLConnect With a Mentor Commented:
Hee, hee.  I'm off to eat.  catch you later.

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

0
 
t0t0Commented:
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
 
RobmonsterCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
m1ndg4m3Author Commented:
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
 
RobmonsterCommented:
t0t0 is correct. Similar problem discussed by MS here:-

http://support.microsoft.com/kb/135268
0
 
m1ndg4m3Author Commented:
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
 
RobmonsterCommented:
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
 
t0t0Commented:
Does fsaua-reset.exe itself not include a command line option to suppress the need to enter Y or N?

0
 
t0t0Commented:
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
 
t0t0Commented:
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
 
t0t0Commented:
Oh, and don't forget to press the carriage-return key (aka the ENTER key) at the end of your CTRL-Z
0
 
t0t0Commented:
Thank you robmonster for your help
0
 
m1ndg4m3Author Commented:
Sorry guys no joy
0
 
QlemoDeveloperCommented:
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
 
t0t0Commented:
Good point. Have you tried just....

   echo y| fsaua-fsreset

or just

   fsaua-reset<yes.txt
0
 
BillDLCommented:


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
 
t0t0Commented:
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
 
m1ndg4m3Author Commented:
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
 
t0t0Commented:
Go on then....
0
 
BillDLCommented:
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
 
BillDLCommented:
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
 
m1ndg4m3Author Commented:
Ok the file is attached, it is only small however I have zipped it anyway.

Thanks
fsaua-reset.zip
0
 
t0t0Commented:
use the -s option
0
 
t0t0Commented:
Use:

   c:\fsaua-fsreset.exe  -s

to suppress prompting
0
 
BillDLCommented:
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
 
BillDLCommented:
Aaaah, you're so quick t0t0.  2 minutes too quick :-)
0
 
t0t0Commented:
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
 
BillDLCommented:
Isn't it your dinner time t0t0?  That way I can play without fear of being beaten to the answer ;-)
0
 
t0t0Commented:
So are you....
0
 
t0t0Connect With a Mentor Commented:
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
 
m1ndg4m3Author Commented:
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
 
BillDLCommented:
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
 
BillDLCommented:
Whoops, I second-guessed another possibility prematurely.  That's great.  Now I'm off to eat.  Thank you m1ndg4m3.
0
 
t0t0Commented:
Blimey BillDL.... You're gonna have to reheat your Pot Noodle.

0
All Courses

From novice to tech pro — start learning today.