[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Trying to hide the Startup folder from the Start Menu

Posted on 2009-05-01
9
Medium Priority
?
2,477 Views
Last Modified: 2013-11-10
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...
0
Comment
Question by:meirionwyllt
  • 4
  • 3
  • 2
9 Comments
 
LVL 9

Assisted Solution

by:djpazza
djpazza earned 800 total points
ID: 24277995
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
 
LVL 4

Expert Comment

by:r0bertdenir0
ID: 24278692
Did you mark the VBS file itself as hidden? Or just the Common Startup folder?
0
 
LVL 4

Accepted Solution

by:
r0bertdenir0 earned 1200 total points
ID: 24278739
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:meirionwyllt
ID: 24279145
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
 
LVL 9

Expert Comment

by:djpazza
ID: 24279165
Are you on a domain?  how many users is this for?
0
 
LVL 9

Expert Comment

by:djpazza
ID: 24279263
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
 
LVL 4

Expert Comment

by:r0bertdenir0
ID: 24279559
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
 
LVL 9

Expert Comment

by:djpazza
ID: 24280279
0
 

Author Comment

by:meirionwyllt
ID: 24303425
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question