Re: Copy all but one file.

Tech-Archive recommends: Fix windows errors by optimizing your registry



On 13 juin, 12:26, "Jeremy" <jer...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Why not use a batch file instead? You can still prompt for the
computernames by using SET /P. Then if you did a copy with robocopy you
could use the /XF switch to exclude specific file names. Something like
this:

---
@ECHO OFF
SET /P OLDNAME=Enter the name of the old computer:
robocopy "\\%OLDNAME%\c$\Documents and settings\%username%" "C:\documents
and settings\%username%" /e /xf desktop.ini
---

"TimM" <T...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message

news:7B44DA46-758A-4566-9083-652B7CE2B436@xxxxxxxxxxxxxxxx



I am trying to copy all the files form the desktop from one computer to
another. The old computer is put in by an input box then inserted into the
script. Is it possible to copy all the files in the Desktop folder except
for
the desktop.ini? Or mayby I'll be lucky and some one will have a script
that
copies a user profile from one PC to another, without relying on the
windows
file transfer utility.

My script:
Set objNetwork = CreateObject("Wscript.Network")
strUserName = objNetwork.UserName
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\" & strOldName & "\c$\Documents And Settings\"& _
strUserName & "\Desktop\*.*" , "C:\Documents And Settings\" &
strUserName & "\Desktop"

--------
Thanks
TimM- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -

Batch file will show a console and this is not a good solution because
user may close it .

.



Relevant Pages

  • Re: VBScript error - Logon login script
    ... The script as written runs for me without error. ... It's acting as if strUserName is blank. ... For Each objGroup In objUser.Groups ... > Sub InformationSystems ...
    (microsoft.public.windows.server.scripting)
  • Logon Script
    ... Basically, when the user logs on, I want the script to pull the "Member Of" tab into a dictionary, and then the script can compare groups from the dictionary, and map network drives based on group membership. ... Dim WSHNetwork ... Dim strUserName ' Current user ... Set ObjGroupDict = CreateMemberOfObject ...
    (microsoft.public.windows.server.scripting)
  • Logon Script
    ... Basically, when the user logs on, I want the script to pull the "Member Of" tab into a dictionary, and then the script can compare groups from the dictionary, and map network drives based on group membership. ... Dim WSHNetwork ... Dim strUserName ' Current user ... Set ObjGroupDict = CreateMemberOfObject ...
    (microsoft.public.windows.server.active_directory)
  • Re: Add AD group to local Admin via user interaction
    ... You say you are adding a domain group to the local administrators group. ... so, then strUserName must be the NetBIOS name of a group, but you specify ... Dim strComputer, strDomain, strDomainGroup, objLocalGroup ... This si what I want the script to do- It will be run from an HTA, ...
    (microsoft.public.windows.server.scripting)
  • RE: Create script to pull variable from a list
    ... script output whether or not the User ID was found or not found in Active ... '/ This section of code checks to see if a folder called UserVerify exists ... StrUserName = TS.ReadLine ... but this only allows me to query on one account at a time. ...
    (microsoft.public.windows.server.scripting)