I have a problem, my program only read batch file.
But i need some code of perl.How i can insert code perl in batch file.
Anybody give me some syntax to insert code perl.
Batch file has code of perl
Moderator: DosItHelp
Re: Batch file has code of perl
You can make the batch create the perl script then run that perl script.
This is how we make it create a VBscript and then run that vbscript:
The blue word is a unique word that is written before each line of the vbscript code and followed with a single space.
The green word in the for command is used to identify the lines that will contain the vbscript code.
The light green line that starts with the "Cscript" is the command used to run vbscripts,
The for command search inside it's batch file for that unique word and take any code after it and put in the file "red word".
You will have to just change the "red words" to match your perl script file name, and add your perl script code in the batch after the "REM write your code here" then add in the beginning of each line of the code the same blue word, ( or change it with any but make sure to change the green word in the for command)
Then replace the light green command and add the one that is used to run perl scripts.
I hope that is clear enough
This is how we make it create a VBscript and then run that vbscript:
The red word "voice.vbs" is the vbscript file that will be created in the same location with this batch file@Echo OFF
IF NOT EXIST "%~DP0Voice.vbs" (
( FOR /F "tokens=1*" %%a IN ('findstr "^:Voice: " ^< "%~F0"') DO Echo.%%b )>"%~DP0Voice.vbs"
)
Cscript //nologo "%~DP0Voice.vbs" "%~1"
Goto :EOF
REM write your code here
:Voice: Dim message, sapi
:Voice: Set sapi=CreateObject("sapi.spvoice")
:Voice: sapi.Speak chr(34) & WScript.Arguments(0) & chr(34)
The blue word is a unique word that is written before each line of the vbscript code and followed with a single space.
The green word in the for command is used to identify the lines that will contain the vbscript code.
The light green line that starts with the "Cscript" is the command used to run vbscripts,
The for command search inside it's batch file for that unique word and take any code after it and put in the file "red word".
You will have to just change the "red words" to match your perl script file name, and add your perl script code in the batch after the "REM write your code here" then add in the beginning of each line of the code the same blue word, ( or change it with any but make sure to change the green word in the for command)
Then replace the light green command and add the one that is used to run perl scripts.
I hope that is clear enough

-
- Posts: 8
- Joined: 13 Nov 2012 20:27
Re: Batch file has code of perl
Thanks you so much abc0502 ^^~