[SOLVED] - 3 Scripts to save me days of work (again)
Moderator: DosItHelp
[SOLVED] - 3 Scripts to save me days of work (again)
Script 1:
I need a script to be placed in master folder and when run the script will drill through every folder within the master seeking out folders with the names "source" "animation" and "export" and delete these folders and anything within these folders yet leave any folders that are not called "source" "animation" & "export" alone.
Script 2:
Again place a script in a master folder and when run it drills through the substructures looking at every folder AND file for spaces in filenames. If it finds a space then remove said space in the file or folder name
Script 3:
Again place a script in a master folder and when run it drills through the substructures looking into any folder called "model" and verifying that one of the 4 filetypes are present. If the folder does not contain either .ma .mb .max or .obj then create a text file output so that I can go look into these manually.
I need a script to be placed in master folder and when run the script will drill through every folder within the master seeking out folders with the names "source" "animation" and "export" and delete these folders and anything within these folders yet leave any folders that are not called "source" "animation" & "export" alone.
Script 2:
Again place a script in a master folder and when run it drills through the substructures looking at every folder AND file for spaces in filenames. If it finds a space then remove said space in the file or folder name
Script 3:
Again place a script in a master folder and when run it drills through the substructures looking into any folder called "model" and verifying that one of the 4 filetypes are present. If the folder does not contain either .ma .mb .max or .obj then create a text file output so that I can go look into these manually.
Last edited by Andrius on 16 Aug 2012 15:53, edited 1 time in total.
Re: [Request] - 3 Scripts to save me days of work (again)
in script2 remove space as delete or replace with _
Re: [Request] - 3 Scripts to save me days of work (again)
UPDATED
Script 1
Script 2
This was posted before Here
Script 3
In this batch a file will be created in the main folder where the batch is, and contain the location and the file type that is missing.
Just Copy the location and past in the windows explorer url and hit enter and you will get to the folder
If you find a location but no file type that mean there is no missing files in that folder, you can ignore it
Script 1
Code: Select all
@Echo off
CLS
For /F "tokens=*" %%A in ('Dir /B /S /A:D *.*') Do (
IF "%%~nA" == "source" RMDIR /S /Q "%%A"
IF "%%~nA" == "animation" RMDIR /S /Q "%%A"
IF "%%~nA" == "export" RMDIR /S /Q "%%A"
)
pause
Script 2
This was posted before Here
Code: Select all
@Echo off
CLS
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "delims=" %%A in ('"dir /b /s|sort /r"') do (
set "f=%%~nxA"
set "f=!f: =!"
if "%%~nxA" NEQ "!f!" (
cd "%%~dpA"
ren "%%~nxA" "!f!"
)
)
pause
Script 3
Code: Select all
@Echo off
CLS
set "location=%~dp0"
For /F "tokens=*" %%A in ('Dir /B /S /A:D *.*') Do (
IF /i "%%~nA" == "Model" (
set "curr=%%~sdpnA"
pushd %%~sdpnA
IF not exist "*.ma" ( Call :report ma )
IF not exist "*.mb" ( Call :report mb )
IF not exist "*.obj" ( Call :report obj )
IF not exist "*.max" ( Call :report max )
popd
)
)
pause
:report
(
echo.%curr%
echo.MissingFileType: %1
echo.
)>>"%location%\MissingFiles.log"
In this batch a file will be created in the main folder where the batch is, and contain the location and the file type that is missing.
Just Copy the location and past in the windows explorer url and hit enter and you will get to the folder
If you find a location but no file type that mean there is no missing files in that folder, you can ignore it
Last edited by abc0502 on 16 Aug 2012 16:45, edited 5 times in total.
Re: [Request] - 3 Scripts to save me days of work (again)
abc0502 wrote:in script2 remove space as delete or replace with _
remove spaces. In our engine we use _ to seperate categories in a way (hard to explain) but basically just looking to remove spaces with this one
Re: [Request] - 3 Scripts to save me days of work (again)
abc0502 wrote:Script 1Code: Select all
@Echo off
CLS
For /F "tokens=*" %%A in ('Dir /B /S /A:D *.*') Do (
IF "%%~nA" == "source" RMDIR /S /Q "%%A"
IF "%%~nA" == "animation" RMDIR /S /Q "%%A"
IF "%%~nA" == "export" RMDIR /S /Q "%%A"
)
pause
Script 2
This was posted before HereCode: Select all
@Echo off
CLS
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "delims=" %%A in ('"dir /b /s|sort /r"') do (
set "f=%%~nxA"
set "f=!f: =!"
if "%%~nxA" NEQ "!f!" (
cd "%%~dpA"
ren "%%~nxA" "!f!"
)
)
pause
Thank you thank you!
Re: [SOLVED] - 3 Scripts to save me days of work (again)
Pretty sure if you searched the forums you would have found your solutions. We did Script 2 just a few weeks ago. Pretty sure we did script 1 not to long ago as well. And well you could always make an attempt at writing them yourself and actually learning how to do it instead of someone always giving you the fish.
Re: [SOLVED] - 3 Scripts to save me days of work (again)
abc0502 wrote:All Files up
Thank you soooo much abc!
Re: [SOLVED] - 3 Scripts to save me days of work (again)
Squashman wrote:Pretty sure if you searched the forums you would have found your solutions. We did Script 2 just a few weeks ago. Pretty sure we did script 1 not to long ago as well. And well you could always make an attempt at writing them yourself and actually learning how to do it instead of someone always giving you the fish.
Im actually an artist on this project which a bit of tech know how and I pick things up as I go.. I just dont have the time to sit down and straight up learn this stuff yet. Today yes I agree I should have been more thorough and searched. it is a crazy day here and I needed a solution quickly and thankfully you guys were able to assist yet again.
trust me it is really appreciated and this should be one of the last things I ask for help with.
Re: [SOLVED] - 3 Scripts to save me days of work (again)
Andrius wrote:Im actually an artist on this project which a bit of tech know how and I pick things up as I go.. I just dont have the time to sit down and straight up learn this stuff yet. Today yes I agree I should have been more thorough and searched. it is a crazy day here and I needed a solution quickly and thankfully you guys were able to assist yet again.
trust me it is really appreciated and this should be one of the last things I ask for help with.
Then shouldn't you have a dedicated tech person for this project?
I am just one of those people who believe in passing it on. If people help you in a community you should also give back to that community. Just my philosophy.
Re: [SOLVED] - 3 Scripts to save me days of work (again)
Squashman wrote:I am just one of those people who believe in passing it on. If people help you in a community you should also give back to that community. Just my philosophy.
I like the thought that they will give back to this, or another community.
Not everyone is suited for writing scripts but they can use a ready made batch file. So if they give back in other ways to another community then that is just as good IMHO.