如何根据批量更改(部件号)的文件名更改文件夹名称

时间:2017-06-29 21:26:03

标签: batch-file

这是我到目前为止所拥有的。我的代码中注释了一些内容,但我认为无论如何我都会在流程中显示它。

@echo off
COLOR 0A

::This is a User prompt.
echo INSERT SA KEY INTO COMPUTER BFORE CONTINUING!
echo.
pause
cls

::This is a User prompt.
echo READY TO RUN EIS ANALYSIS FILE FOLDER PREP!
echo.
pause
cls

::This opens folders needed to perform EIS analysis.
START "" "\\SE\data\PSC_CAMS_DATA\PSC_CAMS\READY_FOR_ANALYSIS"
START "" "C:\INLET\MEASURED"
START "" "C:\INLET"

::This is a User prompt.
::REM echo COPY JOB FOLDER CONTENTS FROM "READY_FOR_ANALYSIS FOLDER"
::REM echo.
::REM echo PASTE INTO "EIS_DATA" FOLDER ON DESKTOP.
::REM echo.
::REM echo PLACE INITIALS IN FRONT OF JOB FOLDER IN "READY FOR ANALYSIS"
::REM echo.
::REM pause
::REM cls

::REM This is a User prompt.
::REM echo CREATING ANALYSIS FOLDER STRUCTURE!
::REM echo.
::REM echo COPYING JOB FOLDER DATA TO C:\INLET!
::REM echo.
::REM echo COPYING JOB FOLDER DATA TO "EIS ARCHIVE"!
::REM echo.
::REM echo "THIS OPERATION WILL TAKE A FEW SECONDS, WAIT FOR PROMPT TO CONTINUE!
::REM echo.
::REM pause
::REM cls


::This creates the folder structure for exporting of the point cloud.
md "C:\INLET\INLETXXXXX\TEMP\EXPORT"
::This creates a folder for the .igs file to perform cross-section & waviness analysis.
md "C:\INLET\MEASURED\InletXXXXX"
::This creates a folder in EIS ARCHIVE for archiving the raw data & analysis reports.
md "\\SE\data\PSC_CAMS_DATA\PSC_CAMS\COMPLETED_PRODUCTION_SURVEYS\EIS_ARCHIVE\LUXXX"
::This copies the SA Job File contents to the C:INLET & EIS ARCHIVE folders.
copy /Y "C:\Users\%USERNAME%\Desktop\EIS_DATA" "C:\INLET\INLETXXXXX"
copy /Y "C:\Users\%USERNAME%\Desktop\EIS_DATA" "\\SE\data\PSC_CAMS_DATA\PSC_CAMS\COMPLETED_PRODUCTION_SURVEYS\EIS_ARCHIVE\LUXXX"
cls
START "" "\\SE\data\PSC_CAMS_DATA\PSC_CAMS\COMPLETED_PRODUCTION_SURVEYS\EIS_ARCHIVE\LUXXX"
cls

::This is a User prompt.
::REM echo UPDATE NAMING CONVENTION OF ALL FOLDERS FOR UNIT NUMBER!
::REM echo.
::REM pause
::REM cls


::REM This is a User prompt.
::REM echo PRESS ANY KEY TO LAUNCH SPATIAL ANALYZER!
::REM echo.
::REM pause
::REM cls
::This launches the Spatial Analyzer64.exe 
START "" "C:\Program Files (x86)\New River Kinematics\SpatialAnalyzer 2015.07.28_6769\x64\Spatial Analyzer64.exe"

::REM This is a User prompt.
::REM echo DRAG AND DROP SA JOB FILE FROM C:\INLET INTO SA ENVIRONMENT!
::REM echo.
::REM echo EXPORT POINT CLOUD TO C:\INLET\INLETXXXXX\TEMP\EXPORT!
::REM echo.
::REM echo DO NOT INCLUDE POINT LABELING!
::REM echo.
::REM pause
::REM cls

::This is a User prompt.
echo OPEN SA FILE AND EXPORT THE POINT CLOUD!
echo.
echo NEXT STEP WILL CLOSE Spatial Analyzer!
echo.
pause
cls

TASKKILL /F /IM Spatial*
::This is a User prompt.
echo EIS ANALYSIS FILE FOLDER PREP FINISHED!
echo HAVE A NICE DAY!  :-)
echo.
pause
cls

我已经尝试了这个,在复制完成后它仍然无法正常工作。它只是关闭批次。我也试过像这样的循环,它仍然无法正常工作。

pause
CD "C:\Users\%USERNAME%\Desktop\EIS_DATA"
for /d "delims='LU'" %%a in (CSR_SC_748_314A6100-4_737_Max_Inlet_Assy_EIS_LU*) do set d=%%a
pause
echo
echo. d : %d%
echo.
pause

set "str1=INLET00"
set "str2=%str1%%d%"
set "str3=Inlet00%d%"
pause
echo.%str2%
echo.%str3%
pause

有什么建议吗? 谢谢!

0 个答案:

没有答案