icecom4
asked on
force a program to start mimimized in registry
How can I set a windows application to start minimized from registry?
Example idea below...
Example idea below...
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\windows\\system32\\cleanmgr.exe"="MINIMIZED"
ASKER
it can be entered into the registry like that?
Enter it into the value of the key just like that and it should work.
ASKER
sorry, not sure what you mean, lets use the whole script. So like this?
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\Windows NT\CurrentVersion\AppCompa tFlags\Lay ers]
start /min "C:\\windows\\system32\\cl eanmgr.exe "
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWA
start /min "C:\\windows\\system32\\cl
Okay, I think this is what you want:
[HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\Windows NT\CurrentVersion\AppCompa tFlags\
Layers]
@="start /min \"c:\\\\windows\\system32\ \cleanmgr. exe"
Let me know
[HKEY_LOCAL_MACHINE\SOFTWA
Layers]
@="start /min \"c:\\\\windows\\system32\
Let me know
ASKER
when I use that, it does not seem to add the string to the AppCompatFlags\Layers
Maybe caused by the word wrap?
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
@="start /min \"c:\\windows\\system32\\cleanmgr.exe"
ASKER
not sure but i think it is the syntax
I just tested the following by placing it in the registry then exporting. I then delete the key and run the .reg file and it imports correctly.
EDIT: Well I got it to work a couple of times and now it won't. hmmm
It will work with
"C:\\WINDOWS\\system32\\ms hta.exe"=" EnableNXSh owUI"
on my system.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
@="start /min \"c:\\windows\\system32\\cleanmgr.exe"
EDIT: Well I got it to work a couple of times and now it won't. hmmm
It will work with
"C:\\WINDOWS\\system32\\ms
on my system.
ASKER
Hmm not sure what I am doing wrong. I copied this to a .reg file and after I execute it, I don't see it in the registry, but also the program starts in a full window.
What OS are you using? Does it require a reboot or something?
What OS are you using? Does it require a reboot or something?
I was testing on an XP since that is what I have at work. I did not have to do a reboot. I was doing it as a .reg file. When it started failing I was getting the same result.
I manually created the key/string value, exported the key, deleted the key, ran the .reg file and the first few times it worked. After that it started failing. I replaced the string value with what I showed previously in the .reg file and ran it and it shows up in the registry.
I will see if I can look at it again however I have a meeting right now that will last a couple of hours.
I manually created the key/string value, exported the key, deleted the key, ran the .reg file and the first few times it worked. After that it started failing. I replaced the string value with what I showed previously in the .reg file and ran it and it shows up in the registry.
I will see if I can look at it again however I have a meeting right now that will last a couple of hours.
ASKER
ok, I am on win 7.
I hope this is possible lol, i dont see many threads identical to my request
I hope this is possible lol, i dont see many threads identical to my request
Wow, I must have looked at my code a thousand times and kept missing the "[" before the HKEY.
I have tested putting this code in the registry several times and it works now:
I used notepad for testing because that is a program that is common to all systems.
I have tested putting this code in the registry several times and it works now:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags]
"Layers"="cmd.exe /c start /min C:\\WINDOWS\\system32\\notepad.exe"
I used notepad for testing because that is a program that is common to all systems.
ASKER
I tested this on XP and 7. This does enter a registry key, but it does not open notepad minimized.
I am not sure but I think the key must be
See first post
Yours makes a key called "layers" under AppCompatFlags then adds a value
but I think it needs to be a path all the way to layers, then a key
Hope I explained that right.
I say this because I have tried a video game that I entered the same string but made value "RUNASADMIN" which simulates clicking on run as administrator in the properties, and it works.
I am not sure but I think the key must be
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"key here"
See first post
Yours makes a key called "layers" under AppCompatFlags then adds a value
but I think it needs to be a path all the way to layers, then a key
Hope I explained that right.
I say this because I have tried a video game that I entered the same string but made value "RUNASADMIN" which simulates clicking on run as administrator in the properties, and it works.
Okay, you want (have) a key named Layers. You want a value in that key to start the program minimized. Your original post does not indicate naming the value. I think that is where I was getting confused.
You are correct. I expected to find notepad running minimized this morning but it was not there.
After reviewing what we are attempting here I think I see what is going on. The registry location we are working with is simply setting the compatibility mode. To actually have the program run when windows starts it needs to be placed in the following location:
HKEY_LOCAL_MACHINE\SOFTWAR E\Microsof t\Windows\ CurrentVer sion\Run
or for user specific:
HKEY_CURRENT_USER\Software \Microsoft \Windows\C urrentVers ion\Run
Try running this from the command line to see the effects:
cmd.exe /c start /min C:\\WINDOWS\\system32\\not epad.exe
You should see that notepad started in minimized mode.
Here is the actual .reg file:
You are correct. I expected to find notepad running minimized this morning but it was not there.
After reviewing what we are attempting here I think I see what is going on. The registry location we are working with is simply setting the compatibility mode. To actually have the program run when windows starts it needs to be placed in the following location:
HKEY_LOCAL_MACHINE\SOFTWAR
or for user specific:
HKEY_CURRENT_USER\Software
Try running this from the command line to see the effects:
cmd.exe /c start /min C:\\WINDOWS\\system32\\not
You should see that notepad started in minimized mode.
Here is the actual .reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Notepad"="cmd.exe /c start /min C:\\WINDOWS\\system32\\notepad.exe"
ASKER
Ok so compatflags is the wrong place for it in the registry, that makes sense.
So it does work from command line, and it does add a key in new spot, but once again the notepad does not start minimized automatically. I am not sure but I thought that registry string you gave was for startup programs.
Verify on your system, right-click on notepad.exe in the accessories menu and does it say start minimized or normal window?
Anyway thanks for all your help with this, sorry its not a quick ticket
So it does work from command line, and it does add a key in new spot, but once again the notepad does not start minimized automatically. I am not sure but I thought that registry string you gave was for startup programs.
Verify on your system, right-click on notepad.exe in the accessories menu and does it say start minimized or normal window?
Anyway thanks for all your help with this, sorry its not a quick ticket
I am mixing the two options here. Your original option to add /MINIMIZED at the end of the command is correct for the registry change if put in the correct place.
What I gave with the /min switch would work in a batch file that you could add to the startup folder.
So try:
What I gave with the /min switch would work in a batch file that you could add to the startup folder.
So try:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Notepad"="cmd.exe /c start C:\\WINDOWS\\system32\\notepad.exe /MINIMIZED"
ASKER
hmm notepad still starts full window
Interesting. It started minimized on my system this morning.
This is exactly what is in my registry (except I removed all non-notepad related items):
This is exactly what is in my registry (except I removed all non-notepad related items):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"Notepad"="cmd.exe /c start /min C:\\WINDOWS\\system32\\notepad.exe"
ASKER
i put this in a .reg file, tried it on both an XP and Win7 system, it did enter the key in registry...but again...notepad seems unaffected.
I do get a error when windows boots now, its trying to start notepad lol, but again, that is not my goal...not during startup.
I want a way to start the application minimized any time it is clicked on by the user. just like we can set the runasadmin and compatibility mode in registry, I need a way to set the full window versus minimized.
I do get a error when windows boots now, its trying to start notepad lol, but again, that is not my goal...not during startup.
I want a way to start the application minimized any time it is clicked on by the user. just like we can set the runasadmin and compatibility mode in registry, I need a way to set the full window versus minimized.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"C:\\windows\\system32\\cl
to:
start /min "C:\\windows\\system32\\cl