Results 1 to 6 of 6

Thread: Very simple popup window

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Very simple popup window

    What I want is to be able to execute a file from a batch file that will pop up a little window that says something like "installation complete" and then "close this window to continue" and that's it. Not fancy like resizeable or scroll bars or menu bars or anything like that.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Creating a popup window is easy. Google "popup window javascript" or "window.open javascript". You can also create a new window (not a popup exactly) using <a href... target="_blank">. (That's not valid in some newer doctypes, but it does work and it used to be valid.)
    Then you can put any content on the page you'd like including that text. The scrollbars would actually be easy since window.open supports these features (or at least suggests them to the browser), if you did want that also. (But of course you can leave that blank and not get them too.)

    However, I don't know what you mean about a "batch file" because the only thing I know by that name is something that executes like an .exe on your computer and NEVER from a website. That would be way too much of a security risk and no browser allows it, and that's a very good thing. If they did, it would be just that simple to install a virus on someone's computer.
    If you are simulating this (maybe?), you can use the method above, and if you require that this actually works, then I suggest:
    1. Rethink the entire website and try to find a better way. For example, you can just allow users to download the .exe if they want and run it. But it won't do that from your page.
    2. Something like this may be possible using ActiveX, a component of internet explorer. It won't work in any other browser, but if this is for a very specific purpose (an office, for example) that may not be a problem. Of course even ActiveX won't give you full access: you'll need to have the user allow you full access to the computer, and there's no reason to think anyone would do that (unless, again, it is for an office or something).
    3. If none of this works, then you can do something like this using a Java applet in the page. That means learning Java (note: not Javascript) which is a complicated language (especially if it's only for this) then requiring that all users have Java installed which isn't everyone, probably less than flash for example. Another plugin could do the same thing, but the only one that is widely available that can do this is Java.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    douglas18 (07-07-2010)

  4. #3
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    djr33, Thank you for your reply.

    I'm sorry, I think I might not have been very clear. This isn't running from a web page, in fact, these computers aren't even connected to the internet. I am using a batch file to automate the installation and modification of some programs on the PCs. At times, I will need to give notice to the installer, like "plug in adapter now" or "installation complete". I don't want to just display the message in the console window because the users are (very, very) dumb. So they need a simple window that shows up that just gives the message.

    I was thinking of making a .html file that sits on the installation disk that when the installation gets to a certain point it just executes the .html file. It's not linked from an internet page or anything like that. The page that pops up will just give the message. That is why I mentioned not having menu bars or anything like that, just to make it simple.

    So how do I make a .html file that disables the menus when I double click it (or execute it from a batch file)?

    Or if there is a better way to get a message across that would be good too.

  5. #4
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Creating a popup window is easy...
    Maybe what I want is called a message box?

  6. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, I see what you mean. That makes a lot more sense now.

    First, be aware that this isn't really a forum for anything aside from web design (and a few things peripherally related to web design), so you may get a much better answer at a forum for programming in whatever language you are using (C#, Java, etc).

    Second, popup windows are created on the linking page, not on the popped up page. So there isn't any code you can add to a page that makes it open as a popup, but rather code that you add to a link that creates a new window as a popup (completely unrelated to whatever content may be on that page).

    You could use Javascript to resize the window to look like a popup after it has opened, and the time this would take will vary by the speed of the system. It probably won't be instantaneous (so your users will see at least a quick full screen flash, then a small window, and maybe a long pause as fullscreen). I'm not sure of the best method to do this either, since due to security restrictions some Javascript window functions are restricted to windows that were opened by Javascript (for example, as a popup). So this means you may need to find a workaround. One way I've seen is using Javascript to open a window, which is actually itself, thus basically resetting the security restrictions and resulting in the current window being usable.

    I believe that you could popup a new window of the command prompt that would say this, and that would be easier. And surely there must be a way to do a windows dialog box. I just haven't done anything with this.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. The Following User Says Thank You to djr33 For This Useful Post:

    douglas18 (07-07-2010)

  8. #6
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks again for the reply. Here is what I have come up with:

    Code:
    ECHO off
    
    pause
    
    > usermessage.vbs ECHO Set wshShell = CreateObject( "WScript.Shell" )
    >>usermessage.vbs ECHO wshShell.Popup "Put Text Here", 0, "Title", 0
    WSCRIPT.EXE usermessage.vbs
    DEL usermessage.vbs
    
    pause

    Just putting that in the batch file works great. Thanks again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •