Saturday, 15 February 2014

batch file - Need my renaming function in my script to work with a specific directory other than directory script is located -


I think there should be a simple problem to solve, but do not know how to get it because someone I have already helped me with the code below

I am running the code below to rename my files

  setlocal enabledelayedexpansion for / f %% a In ('dir * RETOUCH * / b') (Set "Name = %% a" & Set "name =! Name: .RETOUCH =!" Ren "%% a" "! Name!")  

I need to work with this directory Currently it only works files

  "c: \ user \ public \ desktop \ upload \% studio% \% ymd% \"  

There is a batch code for your work with some simplification here:

Set (set "name = %% \") to "pre: @echo off setlocal EnableDelayedExpansion %% (" C: \ Users \ Public \ Desktop \ Uploads \% studiosetnumber% \% ymd% \ * RETOUCH * ") ~ Nxa "set" name =! Name: .RETOUCH =! To understand how it works, open a command prompt window, perform the following commands and for each command: "Ren" %% ~ a "! Name!") Endlocal

Read Help Output:

  • For /?
  • set /
  • ren /?

No comments:

Post a Comment