Re: Copy Files

From: Thiago Ferreira (ThiagoFerreira_at_discussions.microsoft.com)
Date: 12/14/04


Date: Tue, 14 Dec 2004 09:29:04 -0800

Well..
My problem is:
I dont use roaming profiles but all users wanna their "links in the desktop"
in all machines that they are logged.
I thought in copy all their links to a shared user's folder on the logoff.
And copy from the shared user's folder to their desktop on login.
The problem about use roaming w2k profiles against this is coz they throw a
lot of large documments in the desktop, or in the "my documents folder",
upseting the normal logging in other machines.
I've found this article about a simple copy:

Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\FSO\*.txt" , "D:\Archive\" , OverwriteExisting

but I have to say the userprofile directory...I've tried to use
"%profilepath%" but didnt work

Tnks

"Marty List" wrote:

>
> "Thiago Ferreira" <ThiagoFerreira@discussions.microsoft.com> wrote in
> message news:8A18841A-CCA4-43FF-BF3B-32C576A57C37@microsoft.com...
> > Hello, I need to copy several files to " %userprofile% " desktop.
> > like "copy *.lnk c:\documents and settings\%username%\desktop\" but in
> VBS.
> >
> > Tnks
>
>
> Are you sure you want to copy .lnk shortcut files? This is not recommended
> because of link tracking, normally you should create them using the
> CreateShortcut method:
> http://msdn.microsoft.com/library/en-us/script56/html/wsMthCreateShortcut.asp
>
>
> If you do want to copy them this should get you started:
>
>
> Option Explicit
>
>
> Dim oFS, oWS
> Dim sDesktop
> Dim bOverwrite
>
> Set oFS = CreateObject("Scripting.FileSystemObject")
>
> Set oWS = CreateObject("WScript.Shell")
>
> sDesktop = oWS.SpecialFolders("Desktop")
>
> If oFS.FolderExists(sDesktop) <> True Then
> WScript.Echo "Failed to find the desktop folder '" & sDesktop & "'"
> WScript.Quit 3
> End If
>
> bOverwrite = False
>
> On Error Resume Next
> oFS.CopyFile "*.lnk", sDesktop, bOverwrite
> If Err.Number <> 0 Then
> WScript.Echo "Error " & Err.Number & " occurred, " & Err.Description
> WScript.Quit Err.Number
> End If
> On Error GoTo 0
>
>
> WScript.Quit 0
>
>
> For more info see the syntax:
> http://msdn.microsoft.com/library/en-us/script56/html/jsmthCopyFile.asp
>
>
>
>
>



Relevant Pages

  • Re: Copy Files
    ... > I dont use roaming profiles but all users wanna their "links in the ... > I thought in copy all their links to a shared user's folder on the logoff. ... > upseting the normal logging in other machines. ...
    (microsoft.public.scripting.vbscript)
  • Re: Roaming Profiles - Access is Denied.
    ... folder redirection for the My Documents folder for each Roaming user because ... Use a combination of Folder Redirection and Roaming Profiles to ... Create a security group called "FolderRedirects" and add the roaming ...
    (microsoft.public.windows.server.sbs)
  • Re: Roaming Profile Creations
    ... Just so you know, the home folder settings is slightly different to My Documents redirection, so if you go down the redirections route, I would recommend against using the Home Folder setting as well. ... Roaming profiles - Under the profile tab of the user account, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Updating records with a fixed sequence...
    ... you have probably not registered the dao library. ... Database is an Object of DAO which A97 defaults to. ... Dim rsCurr As ADODB.Recordset) ... > 'No machines are marked available ...
    (microsoft.public.access.modulesdaovba)
  • Re: Compact and Repair in Front-Ends
    ... eXecute and Delete) on the folder where the MDB file exists. ... installed version of Access on the machines is 2003. ... the frontends have been placed on the desktops of the user machines. ... Db1,Db2, Db3 etc is being left in the server folder, while the actual DB ...
    (microsoft.public.access.tablesdbdesign)