From: Francisco on 5 Apr 2010 15:29 I need a batch or VB script if it can be for remote copying a file to a folder. The original path is C:\Documents and Settings\%userprofile%\Local Settings\Application Data\{ABCDEFGHI}\folder I need to copy all the% userprofile% of the computers and the folder {ABCDEFGHI} is random, changing the letters. The file copy is a need to modify database.edv and continuously. Thanks
From: Pegasus [MVP] on 5 Apr 2010 18:06 "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message news:4FC3EF88-E88A-4CA8-BAB2-954BEB2301F7(a)microsoft.com... > I need a batch or VB script if it can be for remote copying a file to a > folder. > The original path is C:\Documents and Settings\%userprofile%\Local > Settings\Application Data\{ABCDEFGHI}\folder > I need to copy all the% userprofile% of the computers and the folder > {ABCDEFGHI} is random, changing the letters. The file copy is a need to > modify database.edv and continuously. > > Thanks You probably need to think a little more about your requirements, e.g. - Which profile folders do you wish to process? Just the current %UserProfile%? All of them? Including "Default User", "All users", "LocalService" etc.? - Which folders in Application Data do you wish to copy? All of them? Only those that meet certain criteria? - If {ABCDEFGHI} is the source folder, what is the destination folder? - Do you need a recursive copy process? - What if the files already exist in the destination folder?
From: Francisco on 6 Apr 2010 03:27 I said. I need to copy a file each month in the location: C:\Documents and Settings\% userprofile%\Local Settings\Application Data\(ABCDEFGHI)\folder The% userprofile% are all the different users who are in each PC, the file must be crushed with the new. The source folder would be by example \\server\file_new and destination ......\folder, but the problem is that the chain (ABCDEFGHI) is different in PC and each Profile. I execute a psexec on each computer and you would copy that file to the location of each user Example: C:\Documents and Settings\harry\Local Settings\Application Data\{4bac2704-e0af-4c66-9267-6c64d2a62c04}\folder C:\Documents and Settings\frank\Local Settings\Application Data\{fbf7a7b9-b03b-46a3-821e-5cb0616c2ce1}\folder Thanks "Pegasus [MVP]" <news(a)microsoft.com> wrote in message news:uwxH4wQ1KHA.5828(a)TK2MSFTNGP02.phx.gbl... > > > "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message > news:4FC3EF88-E88A-4CA8-BAB2-954BEB2301F7(a)microsoft.com... >> I need a batch or VB script if it can be for remote copying a file to a >> folder. >> The original path is C:\Documents and Settings\%userprofile%\Local >> Settings\Application Data\{ABCDEFGHI}\folder >> I need to copy all the% userprofile% of the computers and the folder >> {ABCDEFGHI} is random, changing the letters. The file copy is a need to >> modify database.edv and continuously. >> >> Thanks > > You probably need to think a little more about your requirements, e.g. > - Which profile folders do you wish to process? Just the current > %UserProfile%? All of them? Including "Default User", "All users", > "LocalService" etc.? > - Which folders in Application Data do you wish to copy? All of them? Only > those that meet certain criteria? > - If {ABCDEFGHI} is the source folder, what is the destination folder? > - Do you need a recursive copy process? > - What if the files already exist in the destination folder?
From: Pegasus [MVP] on 6 Apr 2010 04:06 Here you go: Line1=(a)echo off Line2=for /F %%a in ('dir /b /ad "%UserProfile%\Local Settings\Application Data"') do set Dir=%%a xcopy /y "\\server\file_new\File.mdb" "%Dir%\Folder\" Make sure to unwrap Line2 if your newsreader breaks it into two or more pieces. Note also that the word "crush" in your post is most likely an incorrect translation from Spanish. Its meaning is unclear. "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message news:5D0A7751-1B08-4426-A709-CBB6CB8560D4(a)microsoft.com... > I said. > > I need to copy a file each month in the location: > C:\Documents and Settings\% userprofile%\Local Settings\Application > Data\(ABCDEFGHI)\folder > > The% userprofile% are all the different users who are in each PC, the file > must be crushed with the new. > The source folder would be by example \\server\file_new and destination > .....\folder, but the problem is that the chain (ABCDEFGHI) is different > in PC and each Profile. > > I execute a psexec on each computer and you would copy that file to the > location of each user > > Example: > > C:\Documents and Settings\harry\Local Settings\Application > Data\{4bac2704-e0af-4c66-9267-6c64d2a62c04}\folder > C:\Documents and Settings\frank\Local Settings\Application > Data\{fbf7a7b9-b03b-46a3-821e-5cb0616c2ce1}\folder > > > Thanks > > "Pegasus [MVP]" <news(a)microsoft.com> wrote in message > news:uwxH4wQ1KHA.5828(a)TK2MSFTNGP02.phx.gbl... >> >> >> "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message >> news:4FC3EF88-E88A-4CA8-BAB2-954BEB2301F7(a)microsoft.com... >>> I need a batch or VB script if it can be for remote copying a file to a >>> folder. >>> The original path is C:\Documents and Settings\%userprofile%\Local >>> Settings\Application Data\{ABCDEFGHI}\folder >>> I need to copy all the% userprofile% of the computers and the folder >>> {ABCDEFGHI} is random, changing the letters. The file copy is a need to >>> modify database.edv and continuously. >>> >>> Thanks >> >> You probably need to think a little more about your requirements, e.g. >> - Which profile folders do you wish to process? Just the current >> %UserProfile%? All of them? Including "Default User", "All users", >> "LocalService" etc.? >> - Which folders in Application Data do you wish to copy? All of them? >> Only those that meet certain criteria? >> - If {ABCDEFGHI} is the source folder, what is the destination folder? >> - Do you need a recursive copy process? >> - What if the files already exist in the destination folder? >
From: Francisco on 24 Apr 2010 10:50
This script not running. My script is: @echo off for /F %%a in ('dir /b /ad "%userprofile%\Configuraci�n local\Datos de programa\Microsoft\Folder"') do SET dir=%%a xcopy /y \\server\contacts.db" "%dir%\Folder2\" The error is: parsing error or not expected in('dir in this moment The rute complete is: Computer1: C:\Documents and Settings\Jhon\Configuraci�n local\Datos de programa\Microsoft\Folder\{fbf7a7b9-b03b-46a3-821e-5cb0616c2ce1}\Folder2\ C:\Documents and Settings\Mary\Configuraci�n local\Datos de programa\Microsoft\Folder\{4bac2704-e0af-4c66-9267-6c64d2a62c04}\Folder2\ Computer2: C:\Documents and Settings\Peter\Configuraci�n local\Datos de programa\Microsoft\Folder\{fbf7a7b9-5865-46a3-888e-5cb06812ce1}\Folder2\ ........ Thanks "Pegasus [MVP]" <news(a)microsoft.com> wrote in message news:%23m4lEAW1KHA.5536(a)TK2MSFTNGP04.phx.gbl... > Here you go: > Line1=(a)echo off > Line2=for /F %%a in ('dir /b /ad "%UserProfile%\Local Settings\Application > Data"') do set Dir=%%a > xcopy /y "\\server\file_new\File.mdb" "%Dir%\Folder\" > > Make sure to unwrap Line2 if your newsreader breaks it into two or more > pieces. Note also that the word "crush" in your post is most likely an > incorrect translation from Spanish. Its meaning is unclear. > > "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message > news:5D0A7751-1B08-4426-A709-CBB6CB8560D4(a)microsoft.com... >> I said. >> >> I need to copy a file each month in the location: >> C:\Documents and Settings\% userprofile%\Local Settings\Application >> Data\(ABCDEFGHI)\folder >> >> The% userprofile% are all the different users who are in each PC, the >> file must be crushed with the new. >> The source folder would be by example \\server\file_new and destination >> .....\folder, but the problem is that the chain (ABCDEFGHI) is different >> in PC and each Profile. >> >> I execute a psexec on each computer and you would copy that file to the >> location of each user >> >> Example: >> >> C:\Documents and Settings\harry\Local Settings\Application >> Data\{4bac2704-e0af-4c66-9267-6c64d2a62c04}\folder >> C:\Documents and Settings\frank\Local Settings\Application >> Data\{fbf7a7b9-b03b-46a3-821e-5cb0616c2ce1}\folder >> >> >> Thanks >> >> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >> news:uwxH4wQ1KHA.5828(a)TK2MSFTNGP02.phx.gbl... >>> >>> >>> "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message >>> news:4FC3EF88-E88A-4CA8-BAB2-954BEB2301F7(a)microsoft.com... >>>> I need a batch or VB script if it can be for remote copying a file to a >>>> folder. >>>> The original path is C:\Documents and Settings\%userprofile%\Local >>>> Settings\Application Data\{ABCDEFGHI}\folder >>>> I need to copy all the% userprofile% of the computers and the folder >>>> {ABCDEFGHI} is random, changing the letters. The file copy is a need >>>> to modify database.edv and continuously. >>>> >>>> Thanks >>> >>> You probably need to think a little more about your requirements, e.g. >>> - Which profile folders do you wish to process? Just the current >>> %UserProfile%? All of them? Including "Default User", "All users", >>> "LocalService" etc.? >>> - Which folders in Application Data do you wish to copy? All of them? >>> Only those that meet certain criteria? >>> - If {ABCDEFGHI} is the source folder, what is the destination folder? >>> - Do you need a recursive copy process? >>> - What if the files already exist in the destination folder? >> |