| 1. |
Solve : help creating batch directory renamer? |
|
Answer» i'm working on a server that has some mac clients. unfortunately our end users OFTEN create files and folders with This little snippet is untested as I was unable to create a file or folder name with a trailing dot. thanks for the help. i tried using this but it doesn't seem to be working, maybe i'm doing somethign wrong. the directories i'm working with are located here: Code: [Select]D:\moved user folders\NICOLJ\Event Photography so i modified your code to match that file location Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('D:\movedu~1\NICOLJ\EventP~1 /s /b ^| findstr ".*\.$"') do ( ren "%%i" "%%~ni.dot" ) echo Done and this is what i get Code: [Select]'D:\movedu~1\NICOLJ\EventP~1' is not recognized as an internal or external comma nd, operable program or batch file. Done any more suggestions? Quote @echo off I believe you left out the dir command: Code: [Select]@echo off for /f "tokens=* delims=" %%i in ('dir D:\movedu~1\NICOLJ\EventP~1 /s /b ^| findstr ".*\.$"') do ( if not errorlevel 1 ren "%%i" "%%~ni.dot" ) echo Done! Done!! Done!!! As mentioned, this code is untested. How did your users manage to create files/folders with a trailing dot? I tried quotes and even Explorer, but had no luck. Quote from: Sidewinder on November 25, 2008, 01:17:40 PM Quote@echo off eh, i appriciate the help but that doesn't see to WORK either. the situation is; we have mac users that connect to the server to save files. they save the files with the problems and i[on the server end] find it difficult to work with the files afterwards Quote i appriciate the help but that doesn't see to work either How doesn't it work? Let's start simple and we can build this together. From the command prompt enter the following LINE and post the output (or at least some of it, if it's too lengthy): dir D:\movedu~1\NICOLJ\EventP~1 /s /b | findstr ".*\.$" Once we can see the output, we can build the rest of the command. If it is possible, also post some of the input by running dir on the same directory. |
|