Jump to content

Recommended Posts

Posted

I've looked for a way to lock my computer, although I don't want any password for my user :)

Shutting down the task explorer.exe does give me the effect I want because the computer is kinda hard to use.

So I've created a batch file with "taskkill /f /im explorer.exe", and here comes the tricky part, you can't create a keyboard shortcut to a batch file.

So I've created a shortcut to the batch file and added a keyboard shortcut to the shortcut, still with me?

Pressing my custom keyboard shortcut "ctrl+Alt+L" worked one time and then it didn't work :|

As it turns out you can only create keyboard shortcuts for .exe files.

Somebody got an Idea how to solve the problem (in short terms shutting down the explorer.exe task with a keyboard shortcut without needing to download a program)?

I do got codeblocks so writing a short c++ program might work? Althought don't know how..

Help appreciated :)

Posted

Doesn't it kind of defeat the point? Having a "locked" computer, that isn't locked with a password.

 

Bearing in mind anyone could just restart explorer, and then have full access. (Or whatever way you're planning to let yourself back in)

 

If you're insistent on having it that way, Just doing a 1-line C++ shell execute of the taskkill command would do what you want, if you compile it at an exe though.

 

Steve

Guest TheLibrarian
Posted (edited)

You might as well just use a wireless keyboard and mouse and lock them away whenever you leave the PC - it's almost as secure.

 

Go for the password and lock the PC properly, you won't be sorry you did.

 

 

Or if you *really* want your solution try http://www.copernic.com/winkey/index.html. I doubt it works on anything newer than XP though.

Edited by TheLibrarian
Posted
Doesn't it kind of defeat the point? Having a "locked" computer, that isn't locked with a password.

 

Bearing in mind anyone could just restart explorer, and then have full access. (Or whatever way you're planning to let yourself back in)

 

If you're insistent on having it that way, Just doing a 1-line C++ shell execute of the taskkill command would do what you want, if you compile it at an exe though.

 

Steve

 

I don't like having password because when I start the computer it will stop at the login screen, but I do only got one user so when I don't have any password it will automatically login and this is good if I'm for example away on the toilet. And I don't really got any data on my school laptop that I am afraid to lose because I do you windows mesh for my documents and steam for my games.

 

So I like this method more than password (maybe just because I kinda found it myself whilst playing around..)

 

Haha this is a kinda long reply for which may be a bit unnecessary but english ain't my native language so I'm not perfect at it, but exactly how would you write the c++ line, my knowledge in c++ is a bit below basic :)

Posted

Try this. Copy-and-paste the following code into your PowerShell prompt (or ISE), press Enter and you will get an EXE on your desktop which kills Explorer.exe.

 

Add-Type -OutputType WindowsApplication -OutputAssembly "$Env:UserProfile\Desktop\KillExplorer.exe" @"

using System.Diagnostics;
class Program
{
    static void Main() {

         try {

              Process[] processesByName = Process.GetProcessesByName("Explorer");

              for (int i = 0; i < processesByName.Length; i++) {
                   Process process = processesByName[i];
                   process.Kill();
              }
         }

         catch {
         }
    }

}
"@

 

N.B. When I tested this in a VM, all Windows Explorer processes do get killed, but Explorer relaunches itself automatically afterwards. Anyone know why? Is it the C# code? :confused:

Posted
Try this. Copy-and-paste the following code into your PowerShell prompt (or ISE), press Enter and you will get an EXE on your desktop which kills Explorer.exe.

 

Add-Type -OutputType WindowsApplication -OutputAssembly "$Env:UserProfile\Desktop\KillExplorer.exe" @"

using System.Diagnostics;
class Program
{
    static void Main() {

         try {

              Process[] processesByName = Process.GetProcessesByName("Explorer");

              for (int i = 0; i < processesByName.Length; i++) {
                   Process process = processesByName[i];
                   process.Kill();
              }
         }

         catch {
         }
    }

}
"@

 

N.B. When I tested this in a VM, all Windows Explorer processes do get killed, but Explorer relaunches itself automatically afterwards. Anyone know why? Is it the C# code? :confused:

 

Process kill will always restart explorer, you need to taskkill it

 

Steve

  • Thanks 1
  • 1 month later...
Posted

Just for the record I've found another way to solve the problem, on my laptop I've got some kind of Dell thingie installed by default and by using that program (which I found when pressing Windows Key+X) I could add custom fn+any letter shortcut, and it did support .bat extensions :)

Now I'm thinking about adding so it not only just shutdowns explorer.exe but also removes the cursor, any ideas?

Posted

I know i way around it

 

Where its asks for an .exe do but the following

 

"C:\windows\system32\cscript.exe" "C:\folder\batchfile.bat"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...