Scripts Thread, Favs Script in Coding and Web Development; Hi
i cant seem to get the re-direct favs script from the Wiki to work? IS there something wrong with ...
-
1st July 2009, 11:40 AM #1 Favs Script
Hi
i cant seem to get the re-direct favs script from the Wiki to work? IS there something wrong with my code?
i get the following error: line; 4,char;1, Error; object required: 'fso', code; 880a01a8, source; microsft Vbscript runtime error.
see my code below;
Create Favorites Folder
If Not fso.FolderExists("N:\MY Settings\Favorites") Then
call noFavorites
End If
sub noFavorites
filesys.CreateFolder "N:\MY Settings\Favorites"
END sub
'Re-Direct Favorites
' Variable Initilisations
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
strUserName = objNetwork.UserName
strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Ex plorer\User Shell Folders\Favorites"
strRedirectionPath = "N:\MY Settings\Favorites"
' Write the new Favorites path
objShell.RegWrite strRegKey, strRedirectionPath
' Variable Destruction
Set objShell = Nothing
Set objNetwork = Nothing
-
-
IDG Tech News
-
1st July 2009, 11:44 AM #2 Dim FSO As Object
Set FSO = CreateObject("scripting.filesystemobject")
???
-
-
1st July 2009, 11:47 AM #3 Set FSO = CreateObject("scripting.filesystemobject")
If Not fso.FolderExists("c:\Favorites") Then
call noFavorites
End If
sub noFavorites
fso.CreateFolder "c:\Favorites"
END sub
Should work.
-
Thanks to plexer from:
mtdmitchell (1st July 2009)
-
1st July 2009, 11:54 AM #4 
Originally Posted by
plexer
Set FSO = CreateObject("scripting.filesystemobject")
If Not fso.FolderExists("c:\Favorites") Then
call noFavorites
End If
sub noFavorites
fso.CreateFolder "c:\Favorites"
END sub
Should work.
Cheers my friend, that works fine now
-
SHARE:
Similar Threads
-
By Paul_L in forum Scripts
Replies: 6
Last Post: 2nd October 2008, 02:33 PM
-
Replies: 0
Last Post: 7th November 2007, 12:48 AM
-
By Galway in forum Windows
Replies: 3
Last Post: 29th August 2007, 11:00 AM
-
By wesleyw in forum Scripts
Replies: 4
Last Post: 5th July 2007, 01:58 PM
-
By ajbritton in forum Windows
Replies: 3
Last Post: 19th June 2006, 09:47 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules