Overclock.net banner
1 - 20 of 51 Posts

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #1 ·
Alright, so I've kinda reached a breaking point. I have a bunch of items pinned to the Taskbar, but sometimes I have bad mouse aim and I click the wrong one when I meant to click the one right next to it. This can be especially irritating if that program I accidentally opened takes a long time to open. So, what I'd like to do is to find a way to have a message that pops up first that asks me if I'm sure I want to open it. That way, I can just press Esc for "No" or "Cancel". That way, I don't have to wait for the program to open just so I can close it.

So, do you think there's a way to do this?

Edit: I have been given the solution by larsch (with some additional assistance provided by Quantum Reality as seen in Post # 29). In short, it's a .vbs script as seen in larsch's first post below:

Quote:
Originally Posted by larsch View Post

You can use vbOKCancel. And let us add a question mark also :)

Code:

Code:
result = MsgBox("Do you want to run this application?" + vbCrLf + vbCrLf + WScript.Arguments(0), vbOKCancel + vbQuestion, "Run it?")

If result = vbOk Then WScript.CreateObject("WScript.Shell").Run cmd
I then made some very minor changes to it and then larsch added a question mark icon to the MsgBox. After all that, here's my current version of this script:

Code:

Code:
cmd = ""
x = WScript.Arguments.Count - 1

For i=0 To x
        cmd = cmd + """" + WScript.Arguments(i) + """"
        If i < x Then cmd = cmd + " "
Next

result = MsgBox("Do you REALLY want to open this?" + vbCrLf + vbCrLf + WScript.Arguments(0), vbYesNoCancel + vbQuestion, "Are you sure?")

If result = vbYes Then WScript.CreateObject("WScript.Shell").Run cmd
Here's how to use it:

  1. Open the Folder Options control panel
  2. Make sure to disable "Hide extensions for known file types"
  3. Click OK or press Enter
  4. Create a new Text Document anywhere you want.
  5. Rename it to anything you want, but change the .txt extension to .vbs
  6. Windows will warn you, "If you change a file name extension, the file might become unstable. Are you sure you want to change it?". Click Yes, or just press Enter
  7. Right-click it and choose Edit (or just Right-Click and press 'E')
  8. Copy/paste my current version of this script
  9. Close Notepad
  10. Say "Yes" to saving changes (or just press Enter)
  11. For pinned items on the Taskbar, hold Shift and right-click the pinned item (while holding shift). Let go of shift after right-clicking. For all other shortcuts (including the ones that you might have in the Quick Launch toolbar), just right-click.
  12. Choose Properties
  13. Make sure the path inside the Target box is inside of quotations. If not, then put quotes around it now.
  14. In front of this path (left-click once inside of the box and then press Home, or just hold your left arrow key until you get to the very beginning), put the full path to your script file including its name (and the .vbs extension). So, mine is currently "C:\Confirm.vbs" (with no quotes). Put a space between that and the path for the program in question.
  15. Click OK

Now, when you click that pinned item, you should see something like this:

AreYouSure.png


Yep. Crysis. lol :) I'm obsessed with it. What can I say? Here's what the Target box looks like for my Crysis shortcut (the pinned item on my Taskbar):

C:\Confirm.vbs "C:\Program Files (x86)\Electronic Arts\Crytek\Crysis\Bin32\Crysis.exe"

Anyway, here are some variables in the script that are good to change as you see fit:

Do you REALLY want to open this?

vbYesNoCancel

Are you sure?

For the "vbYesNoCancel" I strongly recommend looking up MsgBox commands because you can't just have it say anything you want (here's a guide I found a few minutes ago - look for the section called "Second Group"). Like, you can't put "vbSureNahGoAway". Note: if you change vbYesNoCancel" to something else, like say "vbOKCancel", then you must also change the following part:

If result = vbYes

to this:

If result = vbOK

That's why I put "OK" in bold.

If you have any questions though, then just post them and I know someone here will be able to answer them!
 

·
To The Game
Joined
·
7,678 Posts
Try maxing out your UAC security settings maybe?
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #3 ·
Quote:
Originally Posted by Chargeit View Post

Try maxing out your security settings maybe?
I don't want to affect everything globally. That's why I said for some programs.
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #5 ·
Quote:
Originally Posted by sub50hz View Post

Maybe just use the key combo to launch. Win+number on taskbar, you know the drill.
Yes, I do that, but sometimes I use the mouse. It depends on what's faster at the time. However, sometimes Win Key + pinned item number doesn't avoid this problem if I fat finger it.

So, can you see now why I want this? It's just getting old, is all.
 

·
To The Game
Joined
·
7,678 Posts

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #7 ·
Quote:
Originally Posted by Chargeit View Post

http://www.ehow.com/how_7297034_stop-asking-whether-open-applications.html

Only other suggestion, is to set up strict UAC, and than manually set up things you don't want affected by it.

Anyway, good luck with it.
That's not working either. I can still open anything I want. Upon start up though, UAC asked if I want to allow Samsung Magician to start. That was the only thing I got a UAC message for.
 

·
To The Game
Joined
·
7,678 Posts
I don't know. Any attempts at searching for it results in countless posts on stopping what you're wanting to happen.

You'd think there was a way, but than again, you never know. I'd like to know myself by now.
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #9 ·
I'm thinking of asking a friend who might be able to make a simple app for this...
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #11 ·
Damn. That would kind of suck for when I actually want to open said program. I guess I was hoping for just "Yes" and "No" buttons to click (or "OK" and "Cancel'). That would be nice and fast, and therefore quite slick.
 

·
Premium Member
Joined
·
10,351 Posts

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #14 ·
Quote:
Originally Posted by Jiiks View Post

Well if you press any key in that solution it will skip the timeout and start the application
thumb.gif
While I'd prefer Esc to say "No", I wonder now if Alt+F4 to close the cmd window will be tolerable. Hmm...
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #15 ·
Quote:
Originally Posted by The Hundred Gunner View Post

You could use some of the information in this thread:

http://www.overclock.net/t/1468654/help-windows-applications-opening-in-notepad

Write a program that will you if you're sure you want to open it, and set it to "intercept" .exes from running. You'll also probably want to filter things out like start-up processes or make it work for only programs that are in your task bar.
I'm not a programmer. I wouldn't even know how to make Hello World without Googling it. lol If I were a programmer, then I would have taken care of this already. ;)
 

·
Registered
Joined
·
133 Posts
You could try with a small vbscript:

Code:

Code:
cmd = ""
x = WScript.Arguments.Count - 1

For i=0 To x
        cmd = cmd + """" + WScript.Arguments(i) + """"
        If i < x Then cmd = cmd + " "
Next

result = MsgBox("Do you want to run this application?" + vbCrLf + vbCrLf + WScript.Arguments(0), VbYesNoCancel, "Run it?")

If result = vbYes Then WScript.CreateObject("WScript.Shell").Run cmd
Prefix the shortcut's target with it: d:\asktorun.vbs "c:\program files\blablabla"
 

·
Registered
Joined
·
396 Posts
Here's a simple c# implementation:

Code:

Code:
using System.Diagnostics;
using System.Windows.Forms;

namespace ConfirmDialog
{
    class Program
    {
        static void Main(string[] args)
        {
            DialogResult dr = MessageBox.Show("Are you sure", "Title", MessageBoxButtons.YesNo);
            if (dr.Equals(DialogResult.Yes))
            {
                Process.Start(System.AppDomain.CurrentDomain.FriendlyName.Substring(1));
            }
        }
    }
}
Basically you would place that exe inside the folder where the real exe is and rename that to same name with the exception of having a extra leading letter and you get a dialog.
tongue.gif
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #19 ·
Do I need visual basic?
 

·
Not new to Overclock.net
Joined
·
79,142 Posts
Discussion Starter · #20 ·
Quote:
Originally Posted by Quantum Reality View Post

Why not purposely set your antivirus to ask you if you really want to run the programs?
Because I don't have one (nor do I want one).
 
1 - 20 of 51 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top