/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Parsing Argument in converting CMD batch script

05/30/2018 761 views

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

Comments

  • You need to show us some code.....
  • 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

All Answers

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?'
Answered 06/01/2018 by: VBScab
Red 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
Answered 06/04/2018 by: ogleg9
White Belt

 
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