I am a newbie to writing DOS batch files. I've been doing countless research on this script and it's becoming futile. I am wanting a script that will search the local drive for a folder (parasysinfo). If this folder is found, I am wanting the script to copy the new folder from my network drive and replace the folder on my local drive. Can you please help me figure this out? Thank you in advanced.
This is what I have so far...
@echo off
setLocal DisableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/b/s/a-d c:\parasysinfo') do (move /y
G:\\filer01\depthome\Paratran\MARK\parasysinfo "%%a")
Search Local Drive and Copy new Folder from Network Drive...
Moderator: DosItHelp
Re: Search Local Drive and Copy new Folder from Network Driv
The space behind delims= split the path if it contents spaces. Remove it.
/a-d excludes folders, you need /ad.
Untested:
Regards
aGerman
/a-d excludes folders, you need /ad.
Untested:
Code: Select all
for /f "tokens=* delims=" %%a in ('dir /b /s /ad c:\parasysinfo') do (
move /y "G:\filer01\depthome\Paratran\MARK\parasysinfo" "%%a"
)
Regards
aGerman
Re: Search Local Drive and Copy new Folder from Network Driv
I appericate the feedback. It's not working. I'll go back to the drawing board.
Re: Search Local Drive and Copy new Folder from Network Driv
OK, step by step.
Will this output the right path?
Regards
aGerman
Code: Select all
@echo off &setlocal
for /f "tokens=* delims=" %%a in ('dir /b /s /ad c:\^|findstr /iec:"\parasysinfo"') do echo %%a
pause
Will this output the right path?
Regards
aGerman