Trying to hide the Startup folder from the Start Menu

I have a vbs script to the Startup folder in Start Menu to change proxy settings and home page according to whether the user uses their laptop at work or out of work.  I want this to be initiated for any new user that logs onto this laptop.  But I want to make it as difficult for the user to remove this.

I placed a shortcut in the All Users Start Menu in the Startup folder, then I made that folder and its contents hidden.  Despite the fact that the All Users Startup folder is hidden in Explorer, it, and the vbs shortcut, stil appear in every user's Start Menu.

How do I make sure this remains hidden?

I'm sure many of you will be asking why don't I just put an entry in the Run key of Regedit to execute the vbs script.  The problem with putting it in current user of course is that it is only applicable for the current user.

I tried it in HKLM, in Run, but something weird happens and the script only half works - the home page changes but the proxy doesn't - although when I manually execute the script after login it works - so I know the script is ok.  It seems that the script only works fully if executed after login, and the Local Machine Run reg entries al run before login don't they?

I then thought of putting it in the Run key within HKEY_USERS\.Default, but for some reason when a user logs on for the first time, this reg entry doesn't get shifted to their Current User 'Run' key as I expected.

So the best option I've come up with so far is to place a shortcut in the Startup folder of the 'All Users' Start Menu, so that it appears for everyone who logs in.

Any better way of doing it?

Thanks

P.S.  Code of I have a vbs script to the Startup folder in Start Menu to change proxy settings and home page according to whether the user uses their laptop at work or out of work.  I want this to be initiated for any new user that logs onto this laptop.  But I want to make it as difficult for the user to remove this.

I placed a shortcut in the All Users Start Menu in the Startup folder, then I made that folder and its contents hidden.  Despite the fact that the All Users Startup folder is hidden in Explorer, it, and the vbs shortcut, stil appear in every user's Start Menu.

How do I make sure this remains hidden?

I'm sure many of you will be asking why don't I just put an entry in the Run key of Regedit to execute the vbs script.  The problem with putting it in current user of course is that it is only applicable for the current user.

I tried it in HKLM, in Run, but something weird happens and the script only half works - the home page changes but the proxy doesn't - although when I manually execute the script after login it works - so I know the script is ok.  It seems that the script only works fully if executed after login, and the Local Machine Run reg entries al run before login don't they?

I then thought of putting it in the Run key within HKEY_USERS\.Default, but for some reason when a user logs on for the first time, this reg entry doesn't get shifted to their Current User 'Run' key as I expected.

So the best option I've come up with so far is to place a shortcut in the Startup folder of the 'All Users' Start Menu, so that it appears for everyone who logs in.

Any better way of doing it?

Thanks.

P.S.  See VBS code below...
meirionwylltSenior Desktop EngineerAsked:
Who is Participating?
 
r0bertdenir0Connect With a Mentor Commented:
I know the file is inside the folder, but did you hide the file itself?
The reason I ask is that if the folder is marked hidden but not the file, it wuld be expected to still show in any user's startup folder.
When I need to hide stuff like this I mark it as a hidden-system file. You can do it to a file or folder.
Use a command prompt to go to C:\Documents and Settings\All Users\Start Menu\Programs\Startup
The prompt should say C:\Documents and Settings\All Users\Start Menu\Programs\Startup>
Type attrib +h +s myscript.vbs
That marks the file as superhidden.
To view these files, you change the Explorer option to "Hide protected operating system files"
0
 
djpazzaConnect With a Mentor Commented:
Hi meirionwyllt, there is a much easier way of doing this using the computer security policy.  

start - run type gpedit.msc - ok

Under computer configuration - windows settings click scripts
double click startup in the left hand pane then click add to add your batch or vbs file and press apply.
0
 
r0bertdenir0Commented:
Did you mark the VBS file itself as hidden? Or just the Common Startup folder?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
meirionwylltSenior Desktop EngineerAuthor Commented:
Thanks, I checked and it was only the folder that was hidden - I thought this would've been taken care of by using the /s switch in the attrib command, but I had misread what the /s switch actually does.

Regarding dipazza's suggestion about using group policy, is there a way to import a reg file with the path of the VB script?  Anyone know where this is kept in the registry?

Thanks.
0
 
djpazzaCommented:
Are you on a domain?  how many users is this for?
0
 
djpazzaCommented:
You may be able to apply the local policy change directly in the registry in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0

example key to import from notepad:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0]
"Script"="C:\\Documents and Settings\\username\\Desktop\\myscript.vbs"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
0
 
r0bertdenir0Commented:
Your method of startup should not matter in this case - whether via the Group Policy or Registry or Common Startup - they r just different means to achieve the same thing.
If a user has access to any 1 of them, they probably have access to all. Your Common Startup folder is normally only modifiable by administrators.
Remember that you don't just have to protect the startup location but the script which is a vbs file. If the user deletes or modifies yr script, it doesn't matter how secure yr startup method.

If you're doing this on a domain, why not modify the user's domain logon script run & have the vbs run from there everytime the user logs on. To be able to run at home - the logon script should also copy the vbs in the Common Startup folder.
That way the most recent version of the vbs script with yr proxy settings need only be kept on the server & is always updated on every pc every time a user logs on.
At home, the script just runs from the startup folder.
0
 
djpazzaCommented:
0
 
meirionwylltSenior Desktop EngineerAuthor Commented:
r0bertdenir0 - thanks for your valuable input, but we are having major problems with group policy from the domain controller at the moment which our server team are denying, so I cannot rely on group policy at this time.

dipazza - the reg key didn't work - when I imported it, it failed to add an item in gpedit.  There must be something else that's added to the registry when items are added through gpedit.

Hiding the files in the Startup folder did the trick, so I'm happy with that as a solution.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.