Batch Script .bat switch that autoconfirm dialogs on XP SP3?

I had been using perfectly a batch scrip using /y switch for auto confirmation or supress dialogs on windows xp sp2, but when i update to windows xp sp3 that switch stoped working and i cant find information anywhere, any ideas how i can make this work again?..

Example for the batch script what used to work: install.bat
"setup.exe" /SILENT /Y

Any ideas or solution?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob WilliamsCommented:
There are numerous "switches"/options for installation of SP3. You can find these by browsing to the folder that contains the exe, using a command prompt, and running:

To run it without user intervention use:
WINDOWSXP-KB936929-SP3-X86-ENU.EXE  /quiet
(silently in the background)
WINDOWSXP-KB936929-SP3-X86-ENU.EXE  /passive
(displays a progress bar)
xpertoPCAuthor Commented:
Im not trying to install SP3, i already have it. The problem that i have is a with any simple batch script that should autoacept or autoconfirm any dialog that apears, with SP2 installed i had no problem with the /Y switch but now with SP3 installed it doesnt work the /Y switch something changed with the SP3.
Rob WilliamsCommented:
Sorry I see what you are saying now. I mis-understood.
The switches (silent & Y) are functions of your setup.exe app not Windows, so it is odd that SP3 would handle them differently. Upon testing other /Y and /Q switches for other apps they seem to work in the same way with SP2, SP3 and Vista.
Sorry I have no suggestions other than to contact the setup.exe vendor. Perhaps others will have suggestions.
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

xpertoPCAuthor Commented:
The problem is not on the setup.exe vendor, i know its on the change from XP SP2 to XP SP3 because the same command stoped working after that on all diferent batch scripts that i have made.

On many of the research i have made i saw something that it changed because they add some new ways to confirm diferent new messages like Yes/No/Cancel/Close/Later (something like that) i think this changed for Vista too so maybe thats why the update to XP SP3.

I Found this information on some Batch Script Site that is what i need to do un my scripts on XP SP3:

The parameter /y, this informs the process to answer "YES" to any confirmation questions. Sometimes you type the DEL or one of its cousins, the system will ask "Are sure you want to do this?" setting /y answers these prompts without interupting the process.

I have been searching a lot for this i hope someone can lend me a hand. Thanks for helping RobWill
Rob WilliamsCommented:
There is no question Microsoft has made minor changes to DOS commands with many Windows versions from NT to Vista. They are generally just that, minor, and often frustrating to figure out the subtle differences. However, switches such as del (delete) /q for silencing the confirmation request still work for Vista and XP SP3. My point is the switch values are determined by the .exe not Windows. For example one DOS command may use /y for confirmation and another /q but the particular .exe determines that, it is not a general switch applied to all Windows/DOS commands.
xpertoPCAuthor Commented:
Well i used that switch for other scripts and i have the same problem for example to auto install and register AnyDVD would be like this:

"AnyDVD.exe" /S /NORESTART <--- this switches are from the .exe has you mention.
"Key.AnyDVD" /Y <--- But this is from windows batch scripting

The files remain the same, on XP SP2 work well, and on XP SP3 dont, thats why i belive that this particular switch has changed and is not from the setup.exe file.

Check the screen shot attachment that shouldnt apear, or should be auto confirmed son XP SP3 but it doesnt:

Rob WilliamsCommented:
That is not a Windows message. The pop up is from your application. It is possible th application is not compatible with SP3, but I do not believe any DOS command switches have changed with SP3.
Also a Google of that message implies the license or trial period for ANYDVD has expired.
xpertoPCAuthor Commented:
And how do you explain that both same code and files work on SP2? i dont see that message or any confirmation boxes, it just gets the job done.

Also a Google of that message implies the license or trial period for ANYDVD has expired.
<-- This message depends on AnyDVD if is registered with or not, with the file that belongs to the version, etc.
Rob WilliamsCommented:
Sorry I do not know. As mentioned I have seen no change in DOS switches with SP3. Perhaps others will have some suggestions.
try this:

echo Y | setup.exe /s

Hi Rob!
Try Netman66's suggestion above.  My comment is just for your additional information and also

There are so many different versions of installer packages that it is sometimes hard to know from the packaged installer what switches may be used.  For example, most packages created with "InstallShield" are "Windows Installer" (msiexec.exe) compliant as far as setup switches are concerned.

However, you also have:

1. InstallMaster/Wise Installation System from Wise Solutions - supposed to comply with the standard switches, but sometimes does not:
2. Inno Setup - open source competitor documented here:
3. Nullsoft Scriptable Install System (NSIS) - open source packager:
4. Ghost Installer by Ethalone - commercial packager:
5. Plenty more like "Setup Factory" -

Other methods of creating automated scripts and compiling them into standalone *.exe's is exemplified by AutoIT3:


Windows XP's "iexpress.exe" repackager:

OK, so the actual "package" may allow for standard or company-specific switches, but once the package is opened to the %TEMP% folder, or wherever, the Windows Installer may then be called and other switches may apply that could not have been used on the original package.

For this reason I normally fully unpack setup packages using WinZip, WinRAR, the Extract or Expand commands, and any other means possible to try and establish what's inside.  In some cases the process is governed by a setup configuration file (eg. an *.ini) that is plain text and editable in Notepad.  In other instances it's one of those cheap home-baked "installers" that is nothing more than an outer wrapping for standard Windows Installer files.

You will find a lot of pre-written setup scripts for common software here:

In answer to your AnyDVD Question:
Look down to the 2nd change in version " 2008 03 30":

"Change (Setup): Removed ability to install without a reboot, because some faulty 3rd party drivers crash".
xpertoPCAuthor Commented:
Sorry for the delay, Ill check out all the switches, but how can i identify wich installer is the setup.exe compacted with?

Im looking for a standard switch for a batch script that does the job its something like Netman66 wrote but didnt work for me.

echo Y | setup.exe /s

What other switches can work? /Y /yes /s |Y |Yes Y| Yes| /q /quiet (Non of this supress the message at the end)

Maybe ill have to start explaining what im trying to do exactly:

I want to uninstall LiveReg silently and this is the batch script i think it worked for me:

Removing LiveReg:
"%programfiles%\Archivos comunes\Symantec Shared\LiveReg\VcSetup.exe" /SILENT /REMOVE /Y

Registering AnyDVD:
copy Key.AnyDVD "%programfiles%\SlySoft\AnyDVD"
"%programfiles%\SlySoft\AnyDVD\Key.AnyDVD" /y
"%programfiles%\SlySoft\AnyDVD\Key.AnyDVD" /yes
"%programfiles%\SlySoft\AnyDVD\Key.AnyDVD" |Y (Any of this supress or acepts the message)

But the /Y switch i think is the one not working for me now. But what i want to learn is how to supress, confirm any dialog that i get on any other batch script that i make. This two messages that i get one on AnyDVD and one on LiveReg are part for each .exe?, what i mean isnt there a way for the .bat to do that for me.

For example here is a screen shot for LiveReg and the message i get when i remove it silently.

I'm not sure what the purpose is of copying the file named "Key.AnyDVD" to those folders, but I assume that it is to place a file containing the registration details in the folder where anyDVD will look it when first run.  I also assume that this file is normally created when you install the program and then manually enter registration details, and that you have copied out this file from a previously installed and registered copy of the program.

To know the acceptable switches for the COPY command, just type   COPY /?  in a command window.

COPY [/switches] sourcefile.ext destinationfile.ext

It is good practice to use the switches telling the copy command whether the files are ascii (plain text) files or binary (usually like program) files as indicated by the /a and /b switches in the COPY /? results, but it usually doesn't make much difference in the end.  The switches you  are concerned with are /y and /-y.

/Y   Suppresses prompting to confirm you want to overwrite an existing destination file.

/-Y  Causes prompting to confirm you want to overwrite an existing destination file.

The default is to prompt, so you just need to add a /y to your command like this:

copy /y Key.AnyDVD "%programfiles%\SlySoft\AnyDVD"

Actually, I always prefer to issue the command in the full way like this:

copy /y Key.AnyDVD "%programfiles%\SlySoft\AnyDVD\Key.AnyDVD"

Used with the copy command as above, you would see the screen output: "1 file(s) copied.".
If you wanted to totally suppress that output and also FORCE a copy and file overwrite without prompting, then you can redirect the screen output into "nul" and you don't have to use the /y switch.  This does just as it says.  You are sending the screen output into thin air.

copy Key.AnyDVD "%programfiles%\SlySoft\AnyDVD\Key.AnyDVD" > nul

If you preferred, you could send the screen results to a text file to create a log like this:

@echo off
set DEST=C:\Program Files\SlySoft\AnyDVD
set LOGFILE=AnyDVD_Log.txt
echo Registering AnyDVD > %LOGFILE%
echo Copying %KEYFILE% to %DEST% >> %LOGFILE%

Your Log File ("AnyDVD_Log.txt" in the same folder as your batch file) will contain the line "1 file(s) copied."

If you really want a full blown log file with details of activities, then the batch file in the CODE SNIPPET will do that.  I am only including this batch file as an example to demonstrate how to test for success or failure when you are not seeing any screen output, as happens when you redirect screen output to "nul" or to a text file.  Perhaps this method, and also the method of using the SET command to create variables, might be useful to you if you write a much more complex batch file that does several things.

The > redirection sends what would normally be displayed or echoed on screen to the file, and creates the file if it doesn't already exist. If the file already exists, then any content will be overwritten.  The >> redirections ADD whatever is redirected to the file AFTER any existing content, without overwriting it.

As far as your silent "LiveReg" uninstallation goes, can I suggest something to you that may assist.  To find out Setup and Uninstall commands for programs (in this case Symantec LiveReg, but you may wish to know others), you have several options:

1. Ask here in Experts-Exchange, and you will find that we will do the steps detailed at No. 2 onwards.

2. Do a google search for key words like "silent install uninstall setup switch symantec livereg" and then experiment with what the results pages tell you are acceptable command line switches.

3. Read any Readme file that is on the program CD, in a downloaded *.zip package, or on the download page for the program, or search the vendor's online support knowledgebase using keywords like "command line setup switches livereg" or "livereg deployment command line".

4. Install the program and search the program's Help file for the type of words detailed above.

5. After installing a program, open REGEDIT and go to the key:
Expand that key to display sub-keys in the Left pane, and look for one named after the program.  If you an't see one with the program name, then you have to click your way down on each sub-key.  Look in the RIGHT pane for the name of the program as displayed in Control Panel > Add/Remove Programs.  It should show against a value named "DisplayName".  Now look for a value named "QuietUninstallString".  If one exists, then double-click on it (or Right-Click > "Modify") to see the full command that you can note down or copy and paste from there to Notepad.

Here is the relevant registry key for LiveReg version exported to a *.reg file.  I found this in a quick google search (I have changed the \\'s you would get in a *.reg file to single \'s):

"DisplayName"="LiveReg (Symantec Corporation)"
"UninstallPath"="C:\Program Files\Common Files\Symantec Shared\LiveReg\VcSetup.exe"
"UninstallString"="C:\Program Files\Common Files\Symantec Shared\LiveReg\VcSetup.exe /REMOVE"
"QuietUninstallString"="C:\Program Files\Common Files\Symantec Shared\LiveReg\VcSetup.exe /SILENT /REMOVE"
"InstallLocation"="C:\Program Files\Common Files\Symantec Shared\LiveReg"
"Publisher"="Symantec Corporation"

Here is an explanation of each value name:

DisplayName = What you see in Add/Remove Programs
DisplayVersion = What shows in Add/Remove Programs in Windows XP
Publisher = self-explanatory
UninstallPath = The file called when you choose "Uninstall"
InstallLocation = The folder in which the file above resides
UninstallString = The command executed for a normal Uninstallation
QuietUninstallString = Same as above, but SILENT!
NoModify = If value is 1, then you can't do a "Custom" install
NoRepair = If value is 1, then you can't run a "repair" install.

So, your Silent Uninstall command is:

"C:\Program Files\Common Files\Symantec Shared\LiveReg\VcSetup.exe" /SILENT /REMOVE


This applies ONLY to LiveReg, and some of the values in the above *.reg file will only apply to programs that install and uninstall in that same manner.  Some that DO install and uninstall in the same way may use switches like the following for another Symantec program named "sevinst.exe" hat is described here:

"C:\Program Files\Common Files\Symantec Shared\SEVINST.EXE" /U /Q

When it comes to programs and applications that install and uninstall using the Windows Installer MSIEXEC.EXE method, then they call msiexec.exe with the relevant *.msi file name and the proper command line switch.  These switches are in the first link of my previous comment and here:

msiexec.exe /x /qn Drive:\Path_To\package.msi

msiexec.exe /i /qn Drive:\Path_To\package.msi

setup.exe /i /qn

/i - Install
/x = Uninstall
/qn = Quiet Mode + No progress

/qn+ would give you only one dialog on completion.

Many "setup.exe" files packaged with a Windows Installer-compliant program (even if not actually named "setup.exe") can be unpacked using WinRAR to reveal the actual *.msi file.  If you see an extra "SFX" tab in a file's Right-Click > Properties, then it is a "Self Extracting" Archive.

Not all "QuietUninstallString" values shown in REGEDIT for *.msi type installers will show a proper "quiet" uninstall command, because uninstalling is usually a much safer thing to do and would be what the author intended.

So in summary (and this has been repeated several times), you can control what happens and doesn't happen using command line switches ONLY IF the setup package recognises the switches being passed to it.

Using /y, or whatever switch you want to try using, will only work to control what can physically be done AT THE COMMAND LINE unless the setup package happens to recognise a /y switch being passed to it.

In your example screenshot of LiveReg Uninstaller showing a restart prompt, you CAN'T script a batch file that clicks the "Aceptar" (or any other) button for you. You CAN, however, create a script in AutoIT3 and convert it to an *.exe file that WILL be able to click buttons for you.  That was the reason I suggested it a while back.

What you now need to do is be able to recognise the setup files for the methods 1 to 5 that I detailed in my previous comment, and know what commands and switches can be used with each type.  The best way to learn this is to actually INSTALL the programs yourself and then check in the registry to see what the Uninstall command is.
The ones that place a log-type file (sometimes an *.inf file and often a file named "Uninst.isu")  in the program folder when you install a program, and then use that for instructions when uninstalling, are quite easy.  You can copy out that file and study it to see how it works, and take a note of the syntax for the setup or Uninstall commands in the registry.

@echo off
set DEST=C:\Program Files\SlySoft\AnyDVD
set LOGFILE=AnyDVD_Log.txt
echo AnyDVD Registration Log File > %LOGFILE%
echo ============================ >> %LOGFILE%
echo.  >> %LOGFILE%
echo Registering AnyDVD >> %LOGFILE%
echo Copying %KEYFILE% to %DEST% >> %LOGFILE%
copy %KEYFILE% "%DEST%\%KEYFILE%" > nul
if errorlevel 1 goto :ERR1
if errorlevel 0 goto :SUCCESS
echo.  >> %LOGFILE%
echo ***** ERROR ***** >> %LOGFILE%
echo. >> %LOGFILE%
echo Unable to copy file %KEYFILE% to folder: >> %LOGFILE%
echo %DEST% >> %LOGFILE%
echo because file %KEYFILE% cannot be found in >> %LOGFILE%
echo folder %~dp0 >> %LOGFILE%
goto :END
echo. >> %LOGFILE%
echo File %KEYFILE% copied successfully to >> %LOGFILE%
echo folder %DEST% >> %LOGFILE%
goto :END
set DEST=

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob WilliamsCommented:
I seem to be missing the issue here I think.
You say; "Im looking for a standard switch for a batch script ". The "silent" switch is not for the batch script, but for the command/application within the batch script such as setup.exe, AnyDVD.exe, copy, del, etc. Is this correct?
If so, there is no such thing as a standard switch. The switch options are determined by whomever wrote the particular application/command, and can be different for every one.
Perhaps I am totaly misunderstanding the question.
Hi Rob.
On the contrary, I believe that you have understood the question, but that xpertoPC has misunderstood the differences between suppressing (a) command line prompts and (b) Windows dialogs generated by a setup routine.  This is exemplified by the screenshots of dialogs where he/she asks why the command switch wasn't able to automatically accept it.

xpertoPC maintains that batch files which worked on XP SP2 to autoconfirm dialogs (not command-line prompts) now do not work in SP3, but did not grasp the difference between switches applied to the COPY command and those applied to a setup.exe file.

Unfortunately xpertoPC's main other source of reference were quoted as:
"Batch for idiots II":
in which someone gave the XP command and switches to silently delete a folder and all contents with backslashes instead of forward slashes.
A more appropriate topic for the above linked page would have been "Batch BY idiots II", and must surely have been misleading to someone who is struggling to understand the issues.

I'm hopeful that our combined explanations will finally be understood by xpertoPC.  I know my last comment was pretty long, but hopefully step-by-step it should reiterate what you have already tried to explain.

Rob WilliamsCommented:
Hi Bill, perhaps I am not that far off track then :-)
Thank you Lee
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.