Parsing Argument in converting CMD batch script
I am converting my CMD batch script into EXE using Admin Script Editor.
In my CMD script, I am parsing arguments. When I converted it to EXE, arguments is no longer being parsed.
Kindly advice.
Thanks.
2 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
6 years ago
https://www.itninja.com/blog/view/admin-script-editor-script-packager-faq
See the section titled 'How do I handle passing command line arguments to packaged scripts?'
Posted by:
ogleg9
6 years ago
@echo off
SET FNAME=%~n0
SET MSG=%*
SET MSG_1=%1
SET MSG_4=%4
echo "%date% %time% Starting" >> %FNAME%.log
echo 000 %MSG% 000 >> %FNAME%.log
echo 111 %MSG_1% 111 >> %FNAME%.log
echo 444 %MSG_4% 444 >> %FNAME%.log
echo "%date% %time% End" >> %FNAME%.log - ogleg9 6 years ago