Rinox Skrevet 23. oktober 2007 Del Skrevet 23. oktober 2007 Hei! Jeg lurer på hvordan jeg kan kopiere en hel mappe med alle filer og mapper innenfor. Noen som vet det? Her er scriptet jeg bruker som ikke fungerer: echo off cls echo Push a button to copy SAM, SYSTEM and the Documents and Settings folder. pause>nul md ..\sam_system xcopy %systemroot%\repair\sam ..\sam_system xcopy %systemroot%\repair\system ..\sam_system if exist c:\Docume~1 goto c_copy else echo There is no Documents and Settings folder in the C drive. if exist a:\Docume~1 goto a_copy else echo There is no Documents and Settings folder in the A drive. if exist d:\Docume~1 goto d_copy else echo There is no Documents and Settings folder in the D drive. if exist e:\Docume~1 goto e_copy else echo There is no Documents and Settings folder in the E drive. if exist f:\Docume~1 goto f_copy else echo There is no Documents and Settings folder in the F drive. :c_copy md ..\c_drive xcopy c:\Docume~1 ..\c_drive echo The Documents and Settings folder in the C drive has been copied. :a_copy md ..\a_drive xcopy c:\Docume~1 ..\a_drive echo The Documents and Settings folder in the A drive has been copied. :d_copy md ..\d_drive xcopy c:\Docume~1 ..\d_drive echo The Documents and Settings folder in the D drive has been copied. :e_copy md ..\e_drive xcopy c:\Docume~1 ..\e_drive echo The Documents and Settings folder in the E drive has been copied. :f_copy md ..\f_drive xcopy c:\Docume~1 ..\f_drive echo The Documents and Settings folder in the F drive has been copied. pause>nul Takk for svar Lenke til kommentar
Wattengård Skrevet 24. oktober 2007 Del Skrevet 24. oktober 2007 Bruk XCOPY. Husker ikke helt parametrene men hvis du skriver XCOPY /? så får du vite det. -C- Lenke til kommentar
Skagen Skrevet 25. oktober 2007 Del Skrevet 25. oktober 2007 (endret) Problemet ligger i at du bruker forkortede navn (c:\Docume~1). Istedet burde du bruke hele banen og putter gåseøyner rundt slikt: XCOPY "C:\Documents and Settings\Username\This is a file with long filename.TXT" "C:\Some folder with long name\Folder\" Og jeg er usikker på bruke av ..\ istedet for å angi fullstendig bane. Ellers vil jeg anbefale deg å se på parametrene til XCOPY ved å skrive XCOPY /? i CMD. Jeg vil anbefale deg å ta med parametrene /E /F /H /K så du får med filattributter, tomme mapper (for å bevare fullstendig mappestruktur) og skjulte filer. Eksempel: XCOPY "C:\Documents and Settings\Username\This is a file with long filename.TXT" "C:\Some folder with long name\Folder\" /E /F /H /K Endret 25. oktober 2007 av skag1 Lenke til kommentar
Anbefalte innlegg
Opprett en konto eller logg inn for å kommentere
Du må være et medlem for å kunne skrive en kommentar
Opprett konto
Det er enkelt å melde seg inn for å starte en ny konto!
Start en kontoLogg inn
Har du allerede en konto? Logg inn her.
Logg inn nå