+ Post New Thread
Results 1 to 4 of 4
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 ...
  1. #1

    Join Date
    Feb 2007
    Location
    Four Oaks
    Posts
    283
    Thank Post
    37
    Thanked 10 Times in 9 Posts
    Rep Power
    20

    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

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    12,966
    Thank Post
    587
    Thanked 1,495 Times in 1,341 Posts
    Rep Power
    398
    Dim FSO As Object
    Set FSO = CreateObject("scripting.filesystemobject")

    ???

  3. #3

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    12,966
    Thank Post
    587
    Thanked 1,495 Times in 1,341 Posts
    Rep Power
    398
    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.

  4. Thanks to plexer from:

    mtdmitchell (1st July 2009)

  5. #4

    Join Date
    Feb 2007
    Location
    Four Oaks
    Posts
    283
    Thank Post
    37
    Thanked 10 Times in 9 Posts
    Rep Power
    20
    Quote Originally Posted by plexer View Post
    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:
+ Post New Thread

Similar Threads

  1. Need a Script if Possible
    By Paul_L in forum Scripts
    Replies: 6
    Last Post: 2nd October 2008, 02:33 PM
  2. Best script ever!
    By Zabu in forum Scripts
    Replies: 0
    Last Post: 6th November 2007, 11:48 PM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 11:00 AM
  4. Does anyone have a script...
    By wesleyw in forum Scripts
    Replies: 4
    Last Post: 5th July 2007, 01:58 PM
  5. Yet another Logon Script
    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
  •