how to run batch script

Unitech Pt630d mobile computer, batch, 1...
December 14, 2010 at 01:46:28
Specs: Windows XP, 2gb
Hi Guys,
i did this script almost 6 months ago but unfortunately i have forgotten how to run the script as i only used this script once before.I had trued my best to run again the script today but failed to obtain output desired.Below is my code:

[code]
@ECHO OFF

SETLOCAL ENABLEDELAYEDEXPANSION

SET Dest="%1"

FOR /F "usebackq tokens=1*" %%b IN (%2) DO (

IF "%%b" EQU "SI_NAME" (
SET file_name=%%c)

IF "%%b" EQU "SI_FILES" (
SET file_files=%%c
SET file_files=!file_files:~9!
SET file_ext=.!file_files:~-4!)

IF "%%b" EQU "SI_CREATION_TIME" (

SET file_date=%%c
SET file_date=!file_date:/=-!
SET file_date=!file_date::=-!

IF "%%b" EQU "SI_CREATION_TIME" (

FOR /F "tokens=1*" %%d IN ("%%c") DO (

FOR /F "tokens=1-3 delims=/" %%f IN ("%%d") DO (

SET file_month=0%%f
SET file_month=!file_month:~-2!
SET file_date=0%%g
SET file_date=!file_date:~-2!
SET file_year=20%%h)

SET date_created=!file_year!-!file_month!-!file_date!

FOR /F "tokens=1-4 delims=: " %%i IN ("%%e") DO (
SET file_hour=%%i
SET file_minute=%%j
SET file_second=%%k

IF "%%l" EQU "PM" (
IF !file_hour! NEQ 12 (
SET /A file_hour=!file_hour!+12))

IF "%%l" EQU "AM" (
IF !file_hour! EQU 12 (
SET /A file_hour=!file_hour!-12))


SET file_hour=0!file_hour!
SET file_hour=!file_hour:~-2!))

SET file_time=!file_hour!-!file_minute!-!file_second!
)

SET combine_day=!file_year!-!file_month!-!file_date!
SET combine_time=!file_hour!-!file_minute!-!file_second!

)

IF "%%b" EQU "SI_PATH" (

SET file_path=%%c
SET file_path=!file_path:~6,27!
SET file_path=!file_path:/=\!


ECHO:
ECHO.Name of File: !file_name!\!combine_day!-!combine_time!
ECHO:
ECHO.Location : C:\Ball\!file_path!\!file_files!
ECHO:
COPY " C:\Ball\!file_path!\!file_files!" "%Dest%!file_name!!combine_day!-!combine_time!!file_ext!"
ECHO:
ECHO:

)

)

EXIT /B
[/code]


the input file is as below (%2) :

[code]
573/814 up
Properties
SI_CREATION_TIME 8/24/10 3:52:53 PM
SI_NAME My Book (First)
SI_FILES SI_FILE1 cc0643f59b4e7b.rpt
SI_VALUE2 18566
SI_PATH frs://Input/f_084/101/226/442222/
SI_VALUE1 282112
SI_NUM_FILES 2
SI_FILE2 cc0642hw3ryf7d.jpg

SI_PARENTID 134435


574/814 up
Properties
SI_CREATION_TIME 8/30/10 4:54:38 PM
SI_NAME My Book (Second)
SI_FILES SI_FILE1 cc0640u87y6t5r4.rpt
SI_VALUE2 30892
SI_PATH frs://Input/g_116/119/022/446222/
SI_VALUE1 435200
SI_NUM_FILES 2
SI_FILE2 cc0645e78676b12.jpg

SI_PARENTID 42778 [/code]


for the destination is based on my own path where i want to place the generated files.

Please guide me on this. Thanks


See More: how to run batch script

Report •

#1
December 15, 2010 at 17:35:16
it's ok guys...I had created new script to overcome my problem.Thanks.

Report •
Related Solutions


Ask Question