/build/static/layout/Breadcrumb_cap_w.png

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
  • You need to show us some code..... - captain_planet 4 years ago
  • Thanks for the input, captain. Here is what I am using.

    @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 4 years ago

Answers (2)

Posted by: anonymous_9363 4 years ago
Red Belt
0
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 4 years ago
White Belt
0
Thanks for the input, captain. Here is what I am using.

@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
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ