Solved

batch file creation

Posted on 2009-04-14
35
1,152 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Expert Comment

by:Robmonster
Comment Utility
t0t0 is correct. Similar problem discussed by MS here:-

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

Author Comment

by:m1ndg4m3
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you robmonster for your help
0
 

Author Comment

by:m1ndg4m3
Comment Utility
Sorry guys no joy
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
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
Comment Utility
Good point. Have you tried just....

   echo y| fsaua-fsreset

or just

   fsaua-reset<yes.txt
0
 
LVL 38

Expert Comment

by:BillDL
Comment Utility


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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 16

Expert Comment

by:t0t0
Comment Utility
Go on then....
0
 
LVL 38

Expert Comment

by:BillDL
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 16

Expert Comment

by:t0t0
Comment Utility
use the -s option
0
 
LVL 16

Expert Comment

by:t0t0
Comment Utility
Use:

   c:\fsaua-fsreset.exe  -s

to suppress prompting
0
 
LVL 38

Expert Comment

by:BillDL
Comment Utility
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
Comment Utility
Aaaah, you're so quick t0t0.  2 minutes too quick :-)
0
 
LVL 16

Expert Comment

by:t0t0
Comment Utility
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
Comment Utility
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
Comment Utility
So are you....
0
 
LVL 38

Accepted Solution

by:
BillDL earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Blimey BillDL.... You're gonna have to reheat your Pot Noodle.

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now