mmarable Posted July 6, 2004 Share Posted July 6, 2004 Well, I figured that it was about time I actually contributed something here seeing that I've gotten a lot of help from the forums.It's a small contribution, but something that I hope is usefull to someone. It's a vb script:Const ForReading = 1Set objFSO = CreateObject("Scripting.FileSystemObject")Set objFile = objFSO.OpenTextFile("C:\Install\Favorites.txt", ForReading)Set objShell = WScript.CreateObject("WScript.Shell")Set colEnvironmentVariables = objShell.Environment("Volatile")strQLFolder = "C:" & colEnvironmentVariables.Item("HOMEPATH") & "\Favorites"WScript.Echo strQLFolderWScript.EchoDo While objFile.AtEndOfStream <> True arrFAVRecord = split(objFile.Readline, ",") Wscript.Echo "Folder: " & arrFAVRecord(0) If objFSO.FolderExists(strQLFolder & "\" & arrFAVRecord(0)) Then Wscript.Echo "Folder exists." Else Set objFolder = objFSO.CreateFolder(strQLFolder & "\" & arrFAVRecord(0)) Wscript.Echo "Folder does not exist. Creating..." End If Wscript.Echo "Title : " & arrFAVRecord(1) Set objURLShortcut = objShell.CreateShortcut(strQLFolder & "\" & arrFAVRecord(0) & "\" & arrFAVRecord(1) & ".URL") WScript.Echo "Link : " & objURLShortcut' Wscript.Echo "URL : " & arrFAVRecord(2) objURLShortcut.TargetPath = arrFAVRecord(2) WScript.Echo "URL : " & objURLShortcut.TargetPath WScript.Echo objURLShortcut.Save i = i + 1Loop WScript.Echo "Total Count: " & iobjFile.Close Link to comment Share on other sites More sharing options...
Nologic Posted July 6, 2004 Share Posted July 6, 2004 Thanks this will be most helpful. Link to comment Share on other sites More sharing options...
rustycaps Posted July 7, 2004 Share Posted July 7, 2004 Wouldn't it be a lot easier to just have the favorites folder on another partition then have the necessary Shell Folder and User Shell Folder reg entries changed accordingly, e.g. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]"Favorites"="F:\\Favorites"Ths is cut from the reg file I have to setup my specific folder, some of which are on that same f: partition - "my documents" and "my pictures" mainly, which eliminates the need to back them up each time you reinstall (aside from normal backups of course). I know some people just have a huge 120Gb (111Gb effective) partition or whatever, but partitions make things like this a lot easier. Link to comment Share on other sites More sharing options...
Radimus Posted July 7, 2004 Share Posted July 7, 2004 favorites(URLs) are just little text files (INI format)... with only a few lines in them... they can easily be made with a batch and echo statements...echo c:\MSFN.url > [DEFAULT]echo c:\MSFN.url >> BASEURL=http://www.msfn.org/board/index.php?act=idxecho c:\MSFN.url >> [InternetShortcut]echo c:\MSFN.url >> URL=http://www.msfn.org/board/index.php?act=idxecho c:\MSFN.url >> Modified=E00313B3D64FC40193echo c:\MSFN.url >> IconFile=http://www.msfn.org/favicon.icoecho c:\MSFN.url >> IconIndex=1you batch writers can easily modify the above example to use variables for the file path Link to comment Share on other sites More sharing options...
prathapml Posted July 7, 2004 Share Posted July 7, 2004 This, I suppose is called "power of community sharing".Within less than a day, I see 3 ways of doing something - and whichever you like, use that method.@mmarableThat's cool (about the script you made).Hoping you would share more ideas with us....... Link to comment Share on other sites More sharing options...
WwTIPPYwW Posted July 7, 2004 Share Posted July 7, 2004 Also - you could use the $OEM$\DOCS folder and add them to the default user folder. I forget the exact folder - but I've added them there.Also a simple self extracting EXE.I believe it can also be added to the answer file. Link to comment Share on other sites More sharing options...
pastl Posted July 7, 2004 Share Posted July 7, 2004 @mmarable,What do I have todo if i don't want to create a folder, just using Link Title and URL?Like That?,MSFN,http://www.msfn.org/Thanks for your help.pastl Link to comment Share on other sites More sharing options...
evilvoice Posted July 7, 2004 Share Posted July 7, 2004 seems to work that way... Link to comment Share on other sites More sharing options...
pastl Posted July 8, 2004 Share Posted July 8, 2004 @evilvoice,thanks for your answer, I'll try it.pastl Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now