Disable This app is preventing shutdown message in Windows 11/10

This is one of the more annoying features of Windows since forever. You restart or shutdown PC, only to be greeted with this kind of message:

Even worse, Windows is saying it is closing apps but many times it never closes them. Countless times I did a shutdown, went away (or even left it overnight) much later and this wwindow was still on!

I get it, this is suppose to prevent us losing some important work but I cant remember when I needed this. Even if you click Cancel it will shutdown sometimes.

Unfortunately, Microsoft doesn’t provide an easy solution/checkbox in settings. Here is how to fix it. You will need to edit registry but it is not hard.

Important: Please only do this if you know what you are doing. Call someone who knows if you don’t. You can mess up Windows if you do something wrong in Registry. I cant be responsible if something goes wrong. Thank you for understanding 🙂

1. Open registry editor.

Click on Start Menu or Search icon and just type “registry” then click on registry editor app. If Windows asks you for permissions just click YES.

2. Navigate to (open):

Computer\HKEY_CURRENT_USER\Control Panel\Desktop

3. In the right panel, right click the empty space and choose New > String. and name it AutoEndTasks. That is important, it has to be named exactly like this.

4. Double click newly created AutoEndTasks (REG_SZ) and set its Value data to 1.

Click OK, close Registry editor, restart Windows.

Note: When you restart Windows after what you just did, you might still get this annoying notice “This app is preventing shutdown message” because Windows has not yet reloaded Registry. Next time you restart or shutdown Windows you should not see this message.

If this doesn’t work, try creating DWORD Value in step 3. For me, DWORD Value didn’t work. Only after I created String value it worked.

Cmder displays {lamb} and {git} instead of λ and current dir

I recently installed cmder for Windows and when I ran it it was displaying {lamb} and {git} instead of λ and current dir.

Cmder displays {lamb} and {git} instead of λ and current dir

It came with the 0.4.2 version of Clink , which apparently is incompatible or doesnt work best with Windows 10.

Solution is very simple:

1. Go to https://mridgers.github.io/clink/ and download ZIP version of  Clink (.exe is probably OK too but I downloaded ZIP). The new version I downloaded was 0.4.9.

2.  Go to the cmder_mini/vendor folder (where you installed cmder) and rename clink folder to something like clink_original (or you can delete it if you like but I prefer to backup first if something goes wrong) and recreate a folder named clink  and simply extract all files from the downloaded ZIP to this folder.

3. Close (if you had it open) and restart cmder and this is what you should see:

cmder clink

Start Menu Search Remains Empty in Windows 10

I installed Windows 10 and after some time search in start menu stopped working. No matter what I typed in, the menu remained empty and the small dots going from left to right (search progress animation) just kept moving and nothing showed.

This is how to solve it: open Task manager (press CTRL + SHIFT + ESC), go to Details tab (If you don’t see it there then check Processes tab) and stop Cortana or SearchUI.exe. Just right click on the task then select End Task. After you end Cortana try searching again.

Gideros Mobile Tutorial : Mobile Game Development

Why am I learning Mobile Game Development?

I always enjoyed making games on C64 and Amiga (AMOS Professional was great!) when I was a kid. Platformers and turn-based RPG games. It is now different time and smartphone games are all the rage. I always wanted to try making some simple mobile game but the first problem was that I am a busy web developer (Codeigniter then Laravel ..) so I don’t have much time for this. The biggest turn off for me was that you have to learn Java or Objective-C to develop for Android or IOS. Yes, it is not hard but somehow I don’t like to learn these languages (and I don0t have MAC). I tried hybrid app development (phonegap,intel xdk..) for a while but using HTM5/CSS somehow just didn’t feel right, especially for gaming. Maybe one day we will get there for now it just can’t compete with native games.  So I always ended up giving up on mobile development….. until I discovered there is a “3rd” way! (Yes, I am new to this 😛 )

Mobile Game Development with Gideros / Lua

Somehow I found Corona SDK (I decided to not use it after reading some forums), Moai, Monkey but finally I decided to use Gideros. I couldn’t believe that you can make fast, almost native speed apps with a language that is not Java or Obj-C! I never used Lua so I am still learning it but somehow it just feels right. So far I am loving Gideros! It is simple, it is free, it has in-built editor and a lot of plugins to get you started. Sure, it is not for the most complicated 3D games but for simple games it is great! One of the best things for me is that you simply install their app on your smartphone and you can test you apps literally instantly over wi-fi! Modify some code, save,  click play and you app will play on your smartphone/tablet!

What do I need to start with Gideros Mobile Game Development?

First, download Gideros for your OS. I will use Windows version.  Second, you should try to get familiar with Lua scripting language.

What kind of tutorial will this be?

I am just a beginner in mobile development, Lua and Gideros so this is not for well versed mobile dev coders. I am making these tutorials so I can come back if I forget things and to write down my progress so in a way you can learn with me. I gave myself a 30 day challenge to see how it goes.  I will start with installation and then with basics.

First part is coming tomorrow, stay tuned.

PS: My main focus is of course still web development with Laravel so I will continue posting Laravel articles.  The blog is not turning itno mobile dev blog. This is just a side “project”,  a learning experience I want to share 🙂

How to pin shortcut or a batch file to Windows 7 Taskbar?

I installed (in this case just extracted files to some folder) great Windows console replacement caled Cmder. When you want to run it you click on Cmder.bat file. I added it to my PATH system variable but I also wanted to pin it on my taskbar. I was quite surprised when I kept dragging the icon to my taskbar and Windows 7 didn’t offer me “Pin to taskbar” option! What gives?

Apparently you can’t pin shortcuts or a batch file to the new Windows 7 Taskbar.

So here is a quick workaround. Let say you extracted it to the folder C:\cmder\Cmder.bat

  1. Open the folder, right click on Cmder.bat file and select “Create shortcut”.
  2. Right click on newly created shortcut and select properties.
  3. Target: input box will contain this text: C:\cmder\Cmder.bat. Replace it with C:\Windows\System32\cmd.exe /C "C:\cmder\Cmder.bat". Don’t forget the quotes.

Save it and now you can drag it to your taskbar 🙂

Again, my Cmder is in C:\cmder\Cmder.bat folder. If you put yours in different folder you have to use your folder in step 3.

Create a WiFi hotspot in Windows 7 and share Internet connection

If you don’t have WiFi router you can still share your internet connection via your PC. I was using connectify.me software and it did the job but it felt bulky,it disconnected at random times (free version) and my laptop fan was on full speed all the time,which was slowing down my PC. I was very surprised when I learned how easy it is to do it by yourself (on windows 7 at least). All you need to do is enter few commands and enable ICS and that’s it! What is great is that you can use this connection with your Nexus 7 or any other smartphone.

1. Click Start and type cmd, then right click cmd.exe and select “run as Administrator”:
cmd run as administrator

2. Run this command (I used “My net” as SSID and “elcoderino” as pass so replace it with your values)

netsh wlan set hostednetwork mode=allow "ssid=My net" "key=elcoderino" keyUsage=persistent

This will create “Microsoft Virtual WiFi Miniport adapter” and will also set up your hostednetwork. Now you need to enable Internet Connection Sharing (ICS) or Network Bridging for this new adapter (don’t worry, it is just few clicks. I enabled ICS connection but you can also bridge networks)

3. Now you simply start or stop new hosted network with these commands (please keep in mind that cmd.exe needs to be “run as administrator” – check step 1)

// to start hostednetwork type
netsh wlan start hostednetwork
// to stop hostednetwork type
netsh wlan stop hostednetwork 

and that’s it! You should now have a working WiFi hotspot! Try connecting with your smartphone or tablet. Why install or even pay for the software when you can have it with few simple steps?

Share localhost over the internet with ngrok

One of the more annoying things when developing on your local computer is that your clients or friends can’t see what you develop. You can upload it on your web server or you can work directly on the web server but that is inconvenient and slow. So I was very happy to discover this great tool called ngrok. There are similar tools (localtunnel etc) but this one is really easy to use.

Who is your daddy and..no..wait..what is ngrok and what does it do?

Ngrok is a cool little program that creates a tunnel from the public internet (http://subdomain.ngrok.com) to a port on your local machine. You can give this URL to anyone to allow them to try out a web site you’re developing without doing any deployment. Of course your local server has to run at the time of sharing but that is not a problem – you just leave your PC on.

How do I run this ngrok?

With ngrok it is super simple to expose a local web server to the internet. On Windows you just download ngrok.exe, unzip it some folder and then in command prompt (cmd) you just tell ngrok which port your web server is running on.

This is the most simple way (This opens port 8080 on your local machine to the internet). Type this in your command prompt:

ngrok 8080

You will see something like this :

Tunnel Status                 online
Version                       0.11/0.8
Protocol                      http
Forwarding                    http://345355bc.ngrok.com -> 127.0.0.1:8080
Web Interface                 http://localhost:4040
# Conn                        0
Avg Conn Time                 0.00ms

Of course the port (in this case 8080) has to be the port that your localhost is running on. Now just give the generated URL (in our example http://345355bc.ngrok.com) to your client or friend and let them test out your application.

You can do a lot more with ngrok, like inspecting your traffic, XML/JSON syntax checking, replaying requests, requiring passwords to access your tunnels, accessing your tunnels over HTTPS, forwarding non-HTTP services, forwarding to non-local services and more.

Check out ngrok here.

Always displays battery icon in windows 7 system tray

How to move an icon (in my case I wanted to move battery icon) from that “hidden” system tray space so it will always be visible in system tray?

Simple, just click on the up arrow to display that “hidden” system tray area, grab the icon (hold the left mouse button) you would like to move and just move it to  the always-visible system tray area.

system tray windows 7
Pic: System tray on windows 7

‘git’ is not recognized as an internal or external command

If you installed Git from windows.github.com you might get this error while running ‘git’ from windows command prompt(cmd):

‘git’ is not recognized as an internal or external command, operable program or batch file.

What you need to do is add Git path to Windows Environment Variables.

First, search for git.exe with windows search. You will find it in directory similar to this one:

C:\Users\user\AppData\Local\GitHub\PortableGit_76ds5d7f65adsf76as5f7as6f5asdf\bin

Add this to Windows Environment Variables :

  • right mouse-click “My Computer” and select “Properties”
  • if on Windows 7 then click on “Advanced system settings”,
  • open “Advanced” tab and click “Environment Variables”,
  • highlight/click on the “Path” variable under “System variables” and click “Edit”,
  • add your specific path to front of “Variable value” field or at the end, separated by a semicolon from the existing entry. Do not add a space between ; and last entry.Also, do not add ; after the last entry

Let say, just for example, that the Git.exe is in C:\Users\something\somefolder\bin folder. So when you edit your path variable it should look like this (thanks to my super Photoshop skills you can see that we are on Advanced tab, that we are editing Path variable and that I excel at making watermarks):

edit system variable git

Click Ok few times and try running Git again.

Sublime Text 2 opens “instant file search” instead of printing left square bracket in Windows

This problem only appears on certain keyboards and languages where left and right square brackets are placed on letters F and G. Even if you have similar problem with different keyboard or key binding /letters you can still use this solution.

I was using Sublime Text 2, which is really fantastic editor, on Windows 7 and encountered a weird problem. When I pressed AltGr+F Sublime Editor 2 didnt print “[” (left square bracket) – it opened Instant File Search tool instead.

The reason for this is that Windows sees AltGr as Ctrl+Alt, and therefore AltGr+F will be understood as Ctrl+Alt+F, which is a default keymap for Instant File Search tool.

To fix this you need to override the default Ctrl+Alt+F shortcut so it will insert the desired character by inputting that shortcut in user key-bindings.

Do this:
1. Select “Preferences > Key Bindings – User” in Sublime Text 2 menu
2. Paste the following code there:

[
{ "keys": ["ctrl+alt+f"], "command": "insert", "args": {"characters": "["} }
]

If your Key Bindings – User file is not empty then just add the code without the square brackets (line 1 and 3) and dont forget to add comma at the end or at the begging of the line.