![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | .vbs Script To Create Start / Programs Menu Item?? Hi Gang Sorry but I'm new to this. I need to create a script (.vbs) that will check if the current user has a particular menu item in his/her Start menu / Programs. If not then it creates it and applies the right properties to it. Can someone help me create this script? Thanks Andy |
My System Specs![]() |
| | #2 (permalink) |
| | Re: .vbs Script To Create Start / Programs Menu Item?? "Andy" <andy.mcvicker@xxxxxx> wrote in message news:2b4de72e-a394-471d-8e91-e70687e62e93@xxxxxx Quote: > Hi Gang > > Sorry but I'm new to this. I need to create a script (.vbs) that > will > check if the current user has a particular menu item in his/her Start > menu / Programs. If not then it creates it and applies the right > properties to it. > > > Can someone help me create this script? > > > Thanks > Andy @echo off if not exist "%UserProfile%\Start Menu\Programs\xxx.lnk" c:\tools\shortcut.exe /x /y /z Note that the second line starts with "if" and ends with "/z". You can download shortcut.exe from here: http://www.optimumx.com/download/#Shortcut. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: .vbs Script To Create Start / Programs Menu Item?? '---------------------------------------- Dim FSO, SH, oFol, oFils, oLNK Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.FileExists("C:\windows\start menu\programs\Notepad.lnk") = True Then DropIt Set SH = CreateObject("WScript.Shell") Set oLNK = SH.CreateShortcut("C:\windows\start menu\programs\Notepad.lnk") With oLNK .TargetPath = "C:\Windows\Notepad.exe" .IconLocation = "C:\Windows\Notepad.exe" .Save End With Set oLNK = Nothing DropIt Sub DropIt() Set FSO = Nothing Set SH = Nothing WScript.Quit End Sub '--------------------------- This sample was written on Win98. On NT systems you'll need to have admin rights and find the intended user's settings folder down inside the C:\Documents and Settings mess, or whatever it's called now on Vista/7. But once you have the right folder path, the rest is pretty much the same. The trick is in knowing about the properties and methods of the objects used: Scripting.FileSystemObject WScript.Shell Shortcut The first two objects are used extensively in VBScript. If you don't download the help file and study those then you won't be able to make much sense out of scripts and you won't be able to write them yourself. http://www.microsoft.com/downloads/d...C48-207D-4BE1- 8A76-1C4099D7BBB9&displaylang=en Quote: > > Sorry but I'm new to this. I need to create a script (.vbs) that > will > check if the current user has a particular menu item in his/her Start > menu / Programs. If not then it creates it and applies the right > properties to it. > > > Can someone help me create this script? > > > Thanks > Andy |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Unusual Start Menu Item... | Vista General | |||
| How do I add an item to the start menu above Programs? | Vista General | |||
| Weird problem: new programs don't create a folder in the Start menu... | Vista General | |||
| Start Menu Item | Vista General | |||
| Videos item for Start Menu? | Vista General | |||