View unanswered posts | View active topics It is currently 19 Apr 2014 16:05



Post new topic Reply to topic  [ 7 posts ] 
Looking for a way to show Splash Screen logo 
Author Message

Joined: 31 Mar 2012 21:31
Posts: 160
Post Looking for a way to show Splash Screen logo
Im looking for a third party utility that can display a logo image before starting the batch file. ABF Splash Screen does this perfectly however the registered version is impossible to get. Splash Screen Machine is also abandoned by the author. Im hoping for an open source app that does this. Anything thats not completely abandoned would work.

Is there a way to do this in VB script or Powershell? maybe theres a light wieght commanf line app that displays only an image in the center of the screen?


27 May 2012 13:58
Profile
Expert

Joined: 22 Jan 2010 18:01
Posts: 1683
Location: Germany
Post Re: Looking for a way to show Splash Screen logo
What is it good for :?

You could do that using HTA (something like HTML without browser window). Place an image "test.jpg" in the same folder of that batch:
Code:
@echo off &setlocal

:: these variables will be expanded in the HTA code
set /a sec = 5
set /a width = 200
set /a height = 170
set "fullname=%cd%\test.jpg"


set "splash=%temp%\tmp.hta"
:: all lines beginning with min. 6 spaces are redirected into the HTA file
>"%splash%" (type "%~f0"|findstr /bc:"      ")
mshta "%splash%"
del "%splash%"

echo Done.
pause
goto :eof
:: End Of Batch

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
          <title>SPLASH</title>

          <hta:application
           id="oHTA"
           applicationname="myApp"
           border="thin"
           borderstyle="normal"
           caption="no"
           contextmenu="yes"
           icon=""
           innerborder="no"
           maximizebutton="no"
           minimizebutton="no"
           navigable="no"
           scroll="no"
           scrollflat="no"
           selection="no"
           showintaskbar="no"
           singleinstance="yes"
           sysmenu="no"
           version="1.0"
           windowstate="normal"
          />

          <style type="text/css">
            body      {margin:0px 0px 0px 0px;}
          </style>

          <script type="text/jscript">
            /* <![CDATA[ */
           
            var oWSH=new ActiveXObject("WScript.Shell");
            var i=parseInt(oWSH.ExpandEnvironmentStrings("%sec%"))*1000;
            var w=parseInt(oWSH.ExpandEnvironmentStrings("%width%"));
            var h=parseInt(oWSH.ExpandEnvironmentStrings("%height%"));
            var s=oWSH.ExpandEnvironmentStrings("%fullname%");
            window.resizeTo(w, h);
            window.moveTo(screen.width/2-w/2, screen.height/2-h/2);


            function start() {
              image.src = s;
              image.height = h;
              image.width = w;
              setTimeout('closing()', i);
            }

            function closing() {
              window.close();
            }
            /* ]]> */
          </script>

        </head>
        <body onload="start()">
          <img id="image" src="" alt="" height="0" width="0" />
        </body>
      </html>


Regards
aGerman


27 May 2012 16:45
Profile

Joined: 08 Apr 2012 17:11
Posts: 187
Post Re: Looking for a way to show Splash Screen logo
The only thing I can do with VBS within a batch is show some text, prompt for input and return some output. Never heard of displaying an image with it, although I think it's not impossible.

Anyway, aGerman's solution should work for you. I don't know HTA, but it just seems legit.


27 May 2012 18:22
Profile WWW

Joined: 31 Mar 2012 21:31
Posts: 160
Post Re: Looking for a way to show Splash Screen logo
Wow agerman, it works very well. Unfortunately, I ran into a problem which you may not be able to help me.

I convert/package almost all my scripts to EXE's (using bat to exe converters such as QuickBFC). This is to package them into single files for easy portability.

For some odd reason your script doesnt like it when I run it from within an EXE. When I do, I see the below errors in the command window. I'm not sure what goes on in the background, but it behaves the same way no matter what bat2EXE converter I use. These converters like to execute the actual .bat files from the %temp% folder as a random file name such as 356543.cmd. Maybe the new location and filename confuses the batch file?

Anyhow, I don't expect you to be familiar with bat2exe converters. If you do figure it out, would love to know how to get around this. Otherwise, I'll use my successfully-working alternate method...

using an autoit script (which has builtin support for displaying images and packaging to exes.

Your method is surprisingly FAST!


These are the errors I get:
FINDSTR: Line 275 is too long.
FINDSTR: Line 344 is too long.
FINDSTR: Line 344 is too long.
FINDSTR: Line 344 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 586 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.
FINDSTR: Line 1629 is too long.


27 May 2012 22:14
Profile
Expert

Joined: 22 Jan 2010 18:01
Posts: 1683
Location: Germany
Post Re: Looking for a way to show Splash Screen logo
MKANET wrote:
Anyhow, I don't expect you to be familiar with bat2exe converters.

I hate these bat2exe thingies since you always run from one problem to the next. I stopped using such tools a long time ago. Batch is a scripting language and if you need an executable then you should learn a programming language that can be compiled.
You should compress your files into a zip archive or create a self extracting archive.

As to your problem:
I don't find too long lines in my code and I cant see 1629 lines. Open your temporary cmd file to see why you get a peck of trouble. No idea what the bat2exe has done to the code :?

Regards
aGerman


28 May 2012 04:18
Profile

Joined: 10 Feb 2012 02:20
Posts: 3649
Post Re: Looking for a way to show Splash Screen logo
aGerman wrote:
Batch is a scripting language and if you need an executable then you should learn a programming language that can be compiled.


I agree.


28 May 2012 04:28
Profile

Joined: 31 Mar 2012 21:31
Posts: 160
Post Re: Looking for a way to show Splash Screen logo
I am finding out lately that I using autoit a lot more to supplement what DOS/Batch-->EXE cant handle; such as in this case. For larger programs that need a UI, I would definitely use something like C#


28 May 2012 12:12
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot] and 3 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 © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.