mtdmitchell Posted July 1, 2009 Posted July 1, 2009 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\Explorer\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
plexer Posted July 1, 2009 Posted July 1, 2009 Dim FSO As Object Set FSO = CreateObject("scripting.filesystemobject") ???
plexer Posted July 1, 2009 Posted July 1, 2009 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. 1
mtdmitchell Posted July 1, 2009 Author Posted July 1, 2009 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
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