Re: Copy Files
From: Thiago Ferreira (ThiagoFerreira_at_discussions.microsoft.com)
Date: 12/14/04
- Next message: Bart Perrier: "Null/Blank/Empty value"
- Previous message: Dave Maners: "Re: Dump to text , csv or Excel!"
- In reply to: Marty List: "Re: Copy Files"
- Next in thread: Dale: "Re: Copy Files"
- Reply: Dale: "Re: Copy Files"
- Reply: Marty List: "Re: Copy Files"
- Messages sorted by: [ date ] [ thread ]
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
>
>
>
>
>
- Next message: Bart Perrier: "Null/Blank/Empty value"
- Previous message: Dave Maners: "Re: Dump to text , csv or Excel!"
- In reply to: Marty List: "Re: Copy Files"
- Next in thread: Dale: "Re: Copy Files"
- Reply: Dale: "Re: Copy Files"
- Reply: Marty List: "Re: Copy Files"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|