Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Batch File - Pause Execution and View Variable Values?
Message
From
10/10/2007 16:49:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
10/10/2007 12:57:10
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Windows
Category:
Computing in general
Miscellaneous
Thread ID:
01260069
Message ID:
01260151
Views:
22
>Tried that and still get the error. If I comment out and change references for the sc.exe, then it works. Must be syntax. Here is the block of code that works, but still shows code that didn't work. Do you see anything obvious?
>
>UPDATE: By testing I found out that the values of the parameters are valid and that it doesn't matter which ones I send, there can even be three, but I think the problem is that the three of them together are too long for the command. They include paths, which is required, so how do I send these paramenters to the batch file?
>
>UPDATE2: Ok, I tried sending 50 characters each for the 3 parameters and it accepted them, so it's not length. Stuff like this drives me nuts. It all works great until it just doesn't.
>
>UPDATE3: Ok, I've changed the run command to this, and I don't get an error, but it's not pausing for me to see what the values of the parameters are either. It just flashes the DOS screen and goes away.
>
>
>RUN "&InstallBatchFilename"  "&scFilename" "&instsrvFilename" "&srvanyFilename"
>
>
>What's below here is what I orignally posted...
>
>
>	LOCAL ;
>		m.CurrentSafetySetting, ;
>		m.InstallBatchCommands
>
>	m.CurrentSafetySetting =  SET('SAFETY')
>	
>	SET SAFETY OFF
>
>	m.InstallBatchCommands = ''
>
>*!*		m.InstallBatchCommands = m.InstallBatchCommands + 'echo "%~f1" "%~f2" "%~f3"' + CHR(13) + CHR(10)
>*!*		m.InstallBatchCommands = m.InstallBatchCommands + 'pause' + CHR(13) + CHR(10)
>*!*		m.InstallBatchCommands = m.InstallBatchCommands + '"%~f1" delete "EMPS"' + CHR(13) + CHR(10)
>*!*		m.InstallBatchCommands = m.InstallBatchCommands + '"%~f2" EMPS "%~f3"' + CHR(13) + CHR(10)
>
>	m.InstallBatchCommands = m.InstallBatchCommands + 'echo %1 %2' + CHR(13) + CHR(10)
>	m.InstallBatchCommands = m.InstallBatchCommands + 'pause' + CHR(13) + CHR(10)
>	m.InstallBatchCommands = m.InstallBatchCommands + '%1 EMPS %2' + CHR(13) + CHR(10)
>
>	m.InstallBatchFilename = SYS(2023)+'\EMPS_Install.bat'
>	STRTOFILE(m.InstallBatchCommands,m.InstallBatchFilename)
>
>*	m.scFilename = SYS(2023)+[\sc.EXE]
>*	STRTOFILE(FILETOSTR([sc.EXE]),m.scFilename)
>
>	m.instsrvFilename = SYS(2023)+[\instsrv.EXE]
>	STRTOFILE(FILETOSTR([instsrv.EXE]),m.instsrvFilename)
>
>	m.srvanyFilename = SYS(2023)+[\srvany.EXE]
>	STRTOFILE(FILETOSTR([srvany.EXE]),m.srvanyFilename)
>
>*	RUN /N sc.exe create "EMPS" binPath= "c:\FMSRun\EMPS.exe"
>*	RUN EMPS_Install.bat "&scFilename" "&instsrvFilename" "&srvanyFilename"
>	RUN EMPS_Install.bat "&instsrvFilename" "&srvanyFilename"
>
Why do you need to send parameters to a batch file you just created? Can't you just insert the values as such?
text to InstallBatchCommands textmerge noshow
"<<m.scFilename>>" EMPS "<<m.srvAnyFileName>>"
endtext
And that's your batch file. You may want to put fullpaths into your variables, because sys(2023) may return a 8.3 shorthand path - which may still work fine in a .bat file, but may be a bit unclear when read by a human.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform