prompt user for password on windows 7 start up and log on in java - windows

I want to prompt user for password whenever user starts windows system or when ever user logs in to windows system, is there any way to capture windows start up event in java?

No, I, unfortunately, do not think this is possible. Your Java application has to be called by Windows when it starts. Java doesn't really have the ability to 'start' other things like this.
Option 1:
One option you have is packaging your application in a jar or executable. Then, check out these directions. You basically want to create a shortcut in the start directory to point to the application. This is only really good if you have a dedicated application already created.
Option 2:
What I would do is try to launch a .bat file on startup. This can be achieved by doing the following:
start > all programs > right-click startup > open > right click batch file > create shortcut > drag shortcut to startup folder
And the batch file would look something like:
java -jar application.jar
I hope this helps you!

Related

How do programs that don't appear in the startup folder auto-execute on startup?

Just out of curiosity I was wondering how this is done. I know you can probably manually make a program startup using windows scheduler, but for something download from the interwebs, such as Discord, how does it autonomously give itself the ability to run on startup without actually being in the startup folder?
I found the answer elsewhere on this site, here is the link and a quote
https://stackoverflow.com/a/20781275/9546874
Add a new startup application Open your registry and find the key [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run].
For each program you want to start automatically create a new string value using a descriptive name, and set the value of the string to the program executable.
For example, to automatically start Notepad, add a new entry of "Notepad"="c:\windows\notepad.exe".
Some applications do not appear in the startup folder but start up automatically anyway. Programmers have the ability to disable their application showing up in the startup folder. To answer your question, it's a decision made by the dev team behind the application.
Here is a link to disable those applications using the shell: Disable items not in the Startup folder
This article goes into depth about how windows uses registry keys to open applications upon startup.
If you would like to disable discord's auto startup, this is how.

C:\windows\SysWow64\CScript.exe window pop up

I created a macro in Excel and i am running it from a .vbs file. It's working fine on my laptop. I copied the same work on a new laptop and each time i am running the vbs file this window appears on the screen.
I have made some research and read that the situation i mentioned is happening when loading CheckNDISPort service on the startup. But i don't believe it's the reason because when i go to task manager and check in the startUp tab i don't find this service. Also when i restart my laptop i don't get this window, only when i am running my vbs file. I am sure there is any problem with my vbs file too because on the other laptops it's working fine.
Any suggestion please how to get ride of this pop up ? For now i am closing the window each time or ending the task from task manager but everytime i run it again so it pops up again.
Thank you very much.
Windows Scripting Host has two interpreter front-ends, wscript.exe and cscript.exe. cscript.exe is a console application and if cscript.exe is set as the default a console window will open every time you execute a script.
Run cmd.exe elevated as administrator and run wscript.exe //h:wscript.
Depending on the Windows version, you might also be able to right-click a .vbs file, select "Open with...", choose %windir%\system32\wscript.exe and check the "default" checkbox.

can I save my current dir and windows in cmder?

How to save my current setup in Cmder
I use Cmder on windows for all of my deving. I use a separate front and back end for my MEAN applications and also gulp for javascript minification. Also to run mongodb I use the cmder.
My window looks like this once everything is running
Every time I start work on my project I have to open all these windows and run the cd commands to get to their respective folders. I was wondering if there was a way to save the session so that I can have all my windows open automatically in their correct dir?
Use startup settings
You can write startup settings that allow you to execute a series of tasks on startup under
Settings > Startup > Tasks
Here you can define what shell starts and what tasks it should perform, with this you can open new tabs and cd to where you need to work.
A simpler version of this is to just go as far as
Settings > Startup
and find the radio button "Auto save/restore opened tabs", this will at least open up you Cmder where you left off, without the cmd's running.
Hope this helps people who use many windows on startup.

How do I get Windows shortcut "Starts In" behaviour when double-clicking on files?

I have a type of data file associated with my program. I can run my program by clicking on a shortcut, or by double-clicking on the data file. Standard Windows stuff.
However, I need to be able to set the Starts In folder to a specific folder. Everything is fine when I use the shortcut (because that has a Starts In parameter), but when I double-click on a data file, the Starts In defaults to the local folder of the data file, which is not what I want.
To be more specific, I'm using a network dongle protection system (Safenet SHK) that requires an XML file to be in the Starts In folder before the protection shell allows my code to be run, so I can't just change the folder in my program, because it hasn't run yet.
What can I do?
You could create a launcher application. This application would do nothing but set the working directory and then start the real application and pass in the name of the file the user is trying to open. Your application shortcut can point to your main application, but the file associations you create would use the launcher.

C: drive access permission in windows 7

In matlab, I used a windows standalone application. There is a line in this application that writes a file in C:\...\...\. When I run the output exe file produced from this windows standalone application, the exe doesn't write in C:\...\...\ neither tells me that there is a security issues in that partition. All the execution does is nothing. But, when I right-click and run the exe as administrator, it runs correctly.
I want to do it without right-click and run as administrator. Are there is a command in matlab that can do that?
If you create a shortcut to your application, you can go to the Properties of the shortcut, click on Advanced in the Shortcut tab, and select "Run as administrator". That way, whenever you start the application from the shortcut it will be run as an administrator.
(Disclaimer: applications really shouldn't "foul their own nest" by writing into Program Files. This is bad design.)
Starting from Vista, unprivileged processes are not allowed to write to protected folders such as Program Files, because Program Files is designed to store code and not data. However, since this limitation has not been enforced in XP, MS has provided a backward-compatibility hack in the form of Virtual Store. Now, when a program tries to write to protected folder, its output is being redirected into a dedicated folder. This way, the program still "thinks" it writes to its usual location, while in fact it writes to an unprotected location. However, when you later check the Program Files location, you might not see the file - because it's not really there.
You can find more details here: User Account Control Data Redirection.
If you are administrator, add full control permission for your username to the destination folder. You do that by right clicking on the folder, going to properties and then security tab. Then edit and add you username with Full Control rights. Then you don;t have to run the the program as an administrator.
There is no way you can elevate a process once it is started, so Matlab cannot possibly have a command for that. Just running Matlab elevated.

Resources