MSFN Forum: Startmenu links - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Startmenu links batchfiles Rate Topic: -----

#1 User is offline   advancedservers 

  • Group: Members
  • Posts: 8
  • Joined: 10-July 05

Posted 11 July 2005 - 04:49 AM

Hi

Jusat wondering if anyone can help me make a startmenu batch file that checks to see if a shortcut exist say "%AllUsersProfile%\Start Menu\Programs\nero" then
del "%AllUsersProfile%\Start Menu\Programs\nero" then run a self extractin sfx file.


i like to install my start menu like this

Applications - Ms office , ect, ect
Communictations
Entertainment
Accesibility
System tools
Utilities - For most of the programs i install say nero & acdsee
Games

anyway any ideas wil be appeciated

Thnx guys


#2 User is offline   jbm 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 626
  • Joined: 16-September 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 July 2005 - 07:27 AM

You'll have to modify this to delete the right short cut and ruun your sfx.

IF EXIST "%AllUsersProfile%\Start Menu\Programs\nero\nero startsmart.lnk" ( 
	del "%AllUsersProfile%\Start Menu\Programs\nero\nero startsmart.lnk"
	start /wait myselfextracting.exe
)
exit


#3 User is offline   advancedservers 

  • Group: Members
  • Posts: 8
  • Joined: 10-July 05

Posted 13 July 2005 - 09:59 PM

THANKS HEAPS

#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 14 July 2005 - 12:34 AM

Here A Vbs Script That Will Remove Files, Shortcuts In These Places.

Blue Text Is The Loctions It Checks In
Green Text Is Where You Would Put The Files Or Shortcuts In To Delete The Files That Are Listed In There Is What I Used To Test This Script.

Quote


Dim Act : Set Act = CreateObject("Wscript.shell")
Dim AUP : AUP = Act.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\Start Menu")
Dim AUPP : AUPP = Act.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\Start Menu\Programs")
Dim UP : UP = Act.ExpandEnvironmentStrings("%UserProfile%\Start Menu")
Dim UPP : UPP = Act.ExpandEnvironmentStrings("%UserProfile%\Start Menu\Programs")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim DFile, DFile1, Garbage, StrDF, StrFD, StrFD1
  '''' PLACE FILE TO DELETE IN GARBAGE, THESE ARE ONLY THE TEST FILES LISTED IN THE ARRAY

Garbage = Array("New Text Document.txt","Eddie.txt","Test.txt","Some Other Folder\Test.txt",_
"Some Other Folder\New Text Document.txt","Some Other Folder\Eddie.txt")

    Function FDel1
  Fso.DeleteFile(DFile)
End Function
    Function FDel2
  Fso.DeleteFile(DFile1)
End Function
    Function MFile1
End Function
    Function Mfile2
End Function
    Function RMF1
  For Each strDF in Garbage
  StrFD = (AUP & "\" & StrDF)
  StrFD1 = (AUPP & "\" & StrDF)
  DFile = (AUP & "\" & StrDF)
  DFile1 = (AUPP & "\" & StrDF)
  If Fso.FileExists(AUP & "\" & strDF) Then FDel1() Else MFile1() End If
  If Fso.FileExists(AUPP & "\" & strDF) Then FDel2() Else MFile2() End If
  Next
End Function
    Function RMF2
  For Each strDF in Garbage
  StrFD = (UP & "\" & StrDF)
  StrFD1 = (UPP & "\" & StrDF)
  DFile = (UP & "\" & StrDF)
  DFile1 = (UPP & "\" & StrDF)
  If Fso.FileExists(UP & "\" & strDF) Then FDel1() Else MFile1() End If
  If Fso.FileExists(UPP & "\" & strDF) Then FDel2() Else MFile2() End If
  Next
End Function
  RMF1 '''' Start The Check In %ALLUSERSPROFILE%\Start Menu And %ALLUSERSPROFILE%\Start Menu\Programs
  RMF2 '''' Start The Check In %UserProfile%\Start Menu\Programs And %UserProfile%\Start Menu\Programs
Here A Script To Test The Above Script.

Quote



Dim Garbage, Loc, strL, StrN, WF
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Act : Set Act = CreateObject("Wscript.shell")
Dim AUP : AUP = Act.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\Start Menu")
Dim AUPP : AUPP = Act.ExpandEnvironmentStrings("%ALLUSERSPROFILE%\Start Menu\Programs")
Dim UP : UP = Act.ExpandEnvironmentStrings("%UserProfile%\Start Menu")
Dim UPP : UPP = Act.ExpandEnvironmentStrings("%UserProfile%\Start Menu\Programs")
Garbage = Array("\New Text Document.txt","\Eddie.txt","\Test.txt")
Loc = Array((AUP),(AUPP),(AUPP & "\Some Other Folder"),(UP),(UPP),(UPP & "Some Other Folder"))
If Not Fso.FolderExists(AUPP) Then Fso.CreateFolder(AUPP) Else On Error Resume Next End If
If Not Fso.FolderExists(UPP) Then Fso.CreateFolder(UPP) Else On Error Resume Next End If

For Each strL in Loc
For Each StrN In Garbage
Set WF = fso.OpenTextFile( strL & StrN,2, true)     
WF.WriteLine "Hello It My Test"
WF.Close
Next
Next
Act.Popup "Completed", 3 ,"End", 0 + 32



#5 User is offline   advancedservers 

  • Group: Members
  • Posts: 8
  • Joined: 10-July 05

Posted 23 July 2005 - 07:28 AM

could you please explain do i use the top code or the bottom code

#6 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 23 July 2005 - 09:15 PM

The Top One Is The Script
The Bottom Script Is To test The top Script.
You would only need the top script.

#7 User is offline   advancedservers 

  • Group: Members
  • Posts: 8
  • Joined: 10-July 05

Posted 24 July 2005 - 01:42 AM

sorry i should od read what you typed

Thanks again

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy