DosTips.com

A Forum all about DOS Batch
It is currently 28 Sep 2016 11:03

All times are UTC-06:00




Post new topic  Reply to topic  [ 22 posts ]  Go to page 1 2 Next
Author Message
PostPosted: 03 Jun 2012 20:46 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
:================================================================+
@echo off &cls mode con:cols=75 lines=20

for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
"%setup%" /S /VERYSILENT /HIDE /SUPPRESSMSGBOXES=%CD%

taskkill /f /im XviD-Dec.exe>nul
:================================================================+

Ok guys sure there is something simple I am missing.. :roll:

when I run a silent install from command-line my .exe installs but
it pop-ups a confirm box to click OK and the batch stalls out.
I added the taskkill but it wont go to the next line of my batch.


Please help,
Thanks! SuzyQ


Top
   
PostPosted: 03 Jun 2012 21:53 
Offline

Joined: 08 Apr 2012 17:11
Posts: 187
Quote:
/SUPPRESSMSGBOXES=%CD%

What on Earth is that? Why is the current directory the value for "supressmsgboxes"?


Top
   
PostPosted: 04 Jun 2012 00:20 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
SuzyQJax wrote:
when I run a silent install from command-line my .exe installs but
it pop-ups a confirm box to click OK and the batch stalls out.
I added the taskkill but it wont go to the next line of my batch.


You will need to disable the confirmation box with a switch, if there is one.

Or use this so they run concurrently. You will still need to deal with the confirmation box.

start "" "%setup%" ....


Top
   
PostPosted: 04 Jun 2012 04:02 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
Foxi your the Man!! :P

Quote:
Or use this so they run concurrently. You will still need to deal with the confirmation box.
start "" "%setup%" ....


There was no switch to disable the box, and the supressmsgbox switch would not work
either but your start "" worked! and then went to my taskkill line which does kills the pop-up box.

Foxi, could you explain Why the start "" would allow this??

Code:
:install
for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT /HIDE /SUPPRESSMSGBOXES=%CD%
:kill confirm box
taskkill /f /im XviD-Dec.exe>nul


Suzy :wink:


Top
   
PostPosted: 04 Jun 2012 04:16 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
Your switch below looks odd. I am not sure that it's set correctly.

/SUPPRESSMSGBOXES=%CD%



Start "" allows all the %setup% programs to run in another process and the batch file can continue.


Top
   
PostPosted: 04 Jun 2012 04:23 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
Fawers .. FYI

Quote:
What on Earth is that? Why is the current directory the value for "supressmsgboxes"?


1.I know my script may be a little over the top but it does not require a file name for my .exe
2.The Supressmsgbox switch is from http://silentswitch.wordpress.com/a/
3.and CD because once everything in my directory is working I will then create a SelF eXtracting
(SFX) Archive File using WinRAR or 7-Zip for my silent unattended install.

My new working code:
Code:
for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT=%CD%
taskkill /f /im XviD-Dec.exe>nul


Top
   
PostPosted: 04 Jun 2012 04:36 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
SuzyQJax wrote:
2.The Supressmsgbox switch is from http://silentswitch.wordpress.com/a/


It is not listed on that page with =%cd%


Your code will fail on a slower machine as the task will be killed before it finishes. You need a delay before the taskkill.


Top
   
PostPosted: 04 Jun 2012 05:33 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
My bad Foxi.. The =%CD% is listed on this site since my .exe is a NSIS installer.
[url][http://code.google.com/p/windows-package-manager/wiki/InstallationScripts
/url]

My finished Install.cmd WORKING Code that I made into a sfx file using winrar...

Code:
:info
:Installs Nic's XviD Decoder for Windows 7

:install
for /f "delims=" %%x in ('dir /b *.exe') do set setup=%%x
start "" "%setup%" /S /VERYSILENT=%CD%

:kill pop-up
taskkill /f /im XviD-Dec.exe>nul

:clean install files from temp folder
set DataDir=%userprofile%\appdata\local\temp
del /q/s/f "%DataDir%">nul&rd /s/q "%DataDir%">nul 2>&1
md "%DataDir%">nul 2>&1

:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax

:refresh desktop with 2-sec delay
taskkill /f /im explorer.exe>nul
ping -n 2 127.0.0.1 >nul
start explorer.exe

exit


Thanks for all your help ... :wink:


Top
   
PostPosted: 04 Jun 2012 05:41 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
You have made an error. =%cd% should not be at the end of those switches and it may have stopped /SUPPRESSMSGBOXES from working.


Top
   
PostPosted: 04 Jun 2012 06:18 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
Foxi I revised my code with a delay as you suggested...
Quote:
Your code will fail on a slower machine as the task will be killed before it finishes. You need a delay before the taskkill.


:install
start "" XviD-Dec.exe /S /VERYSILENT

:delay 1 sec
ping -n 1 127.0.0.1 >nul

:kill pop-up
taskkill /f /im XviD-Dec.exe>nul

:clean temp folder
set DataDir=%userprofile%\appdata\local\temp
del /q/s/f "%DataDir%">nul&rd /s/q "%DataDir%">nul 2>&1
md "%DataDir%">nul 2>&1

:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax

exit

Thanks!! :lol:


Top
   
PostPosted: 04 Jun 2012 06:25 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
The set commands below aren't doing anything AFAICS and you're just registering the file twice.

Code:
:register
set DataDir=%windir%\SysWOW64
regsvr32 /s xvid.ax
set DataDir=%windir%\System32
regsvr32 /s xvid.ax


Top
   
PostPosted: 04 Jun 2012 07:06 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
foxi ..

since its on a 64-bit system it has a 64-bit .ax then the 32-bit
so both Codecs DO need to be registered.


Top
   
PostPosted: 04 Jun 2012 07:22 
Offline
Expert

Joined: 10 Feb 2012 02:20
Posts: 5965
The trouble there is that using the set command doesn't do anything to change directories and you are registering the same file.


Top
   
PostPosted: 04 Jun 2012 07:31 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
Been using that set command for years and it has always worked ..
but If IMYFB then I could use:
regsvr32 /s "%windir%\syswow64\xvid.ax"
regsvr32 /s "%windir%\syswow64\xvid.ax"


Top
   
PostPosted: 04 Jun 2012 07:32 
Offline

Joined: 05 Mar 2010 12:34
Posts: 16
correction.. my bad

regsvr32 /s "%windir%\syswow64\xvid.ax"
regsvr32 /s "%windir%\system32\xvid.ax"


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 22 posts ]  Go to page 1 2 Next

All times are UTC-06:00


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited