From: Pegasus [MVP] on 30 Apr 2010 04:44 I am saying that the script you posted will not generate the output you posted with it. You must have run some slightly different batch file. "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message news:94ADC035-244D-4A2C-8225-2803CD45615C(a)microsoft.com... > I do not understand what you mean > > "Pegasus [MVP]" <news(a)microsoft.com> wrote in message > news:eooGhv65KHA.4344(a)TK2MSFTNGP04.phx.gbl... >>I do not think that you were running the batch file that you posted below. >>Have another look! >> >> "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message >> news:B12AF432-8642-4F98-A8CA-875ED5432022(a)microsoft.com... >>> I say you can not find the path specified >>> >>> [1] @echo off >>> [2] set dest=%userprofile%\Local Settings\Application >>> Data\Microsoft\Forms >>> [3] for /F %%a in ('dir /b /ad "%dest%"') do SET dir=%%a >>> [4] echo xcopy /y "\\server\contacts.db" "%dest%\%dir%\Folder2\" >>> >>> If I put the echo to the last line of it stays in: >>> >>> "C:\Documents and Settings\Peter\Local Settings\Application >>> Data\Microsoft\Forms\\\Folder2\" >>> >>> >>> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >>> news:%23HtGIM%234KHA.1932(a)TK2MSFTNGP05.phx.gbl... >>>> Correction - I omitted a double quote in Line 4. Note also that >>>> "\\server\contacts.db" can be a share name but that it cannot possibly >>>> be a file name. >>>> >>>> [1] @echo off >>>> [2] set dest=%userprofile%\Local Settings\Application >>>> Data\Microsoft\Forms >>>> [3] for /F %%a in ('dir /b /ad "%dest%"') do SET dir=%%a >>>> [4] echo xcopy /y "\\server\contacts.db" "%dest%\%dir%\Folder2\" >>>> >>>> >>>> "Francisco" <francisco(a)NOSPAMhotmail.es> wrote in message >>>> news:DBC1C5F3-939D-48D3-9DAD-8F22CA73D882(a)microsoft.com... >>>>> 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? >>>>>>> >>>>> >>> > |