Hello Sapien Support,
I have a vbs script that waits for arguments prior to collecting and or doing anything at all.
When compiling it using the cscript to exe and then when executing the compiled .exe file then it autocloses.
How to make it "wait for user input"? When executing the script like: cscript GetEvents.vbs /allevents /txt /csv /evtx /evt it works as expected.
Will I need to rewrite that application prior to converting?
Thanks,
VBS to exe using PrimalScript 2018 arguments
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Alexander Riedel
- Posts: 8575
- Last visit: Sat Nov 02, 2024 12:15 pm
- Been upvoted: 42 times
Re: VBS to exe using PrimalScript 2018 arguments
Don't know what your script does or what you call "wait for arguments" means.
Generally you would use InputBox for getting user input.
Can you provide an actual code sample?
Generally you would use InputBox for getting user input.
Can you provide an actual code sample?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: VBS to exe using PrimalScript 2018 arguments
The script is for generating system/application etc. events in different file formats. Below all the comments along with the arguments the user needs to input before the application script does anything at all.
=====
Examples:
cscript GetEvents.vbs "Directory Service" MyFile.TXT /notable
cscript GetEvents.vbs /allevents /csv /txt
cscript GetEvents.vbs System /txt /nostats
cscript GetEvents.vbs /allwmi /evtx /days=20
cscript GetEvents.vbs /allwmi /xml "/except:security,application"
cscript GetEvents.vbs Microsoft-Windows-UAC/Operational /channel /csv
cscript GetEvents.vbs Application /channel /query:*[System[(Level=2)]] /csv
****** Script Finished ******
So question remains will is there an option to pass arguments when 'converting' the script to an .exe or how to accomplish this task? Should i rewrite it?
Thanks,
=====
Examples:
cscript GetEvents.vbs "Directory Service" MyFile.TXT /notable
cscript GetEvents.vbs /allevents /csv /txt
cscript GetEvents.vbs System /txt /nostats
cscript GetEvents.vbs /allwmi /evtx /days=20
cscript GetEvents.vbs /allwmi /xml "/except:security,application"
cscript GetEvents.vbs Microsoft-Windows-UAC/Operational /channel /csv
cscript GetEvents.vbs Application /channel /query:*[System[(Level=2)]] /csv
****** Script Finished ******
So question remains will is there an option to pass arguments when 'converting' the script to an .exe or how to accomplish this task? Should i rewrite it?
Thanks,
Last edited by n1mdas on Wed Jun 13, 2018 12:17 pm, edited 1 time in total.
Re: VBS to exe using PrimalScript 2018 arguments
So many scripts and got confused.Just pass the arguments to the EXE. It works just like the VBS.
I fixed the issue using the -ArgumentList "/allevents /csv /txt /evtx /evt /xml" right after -FilePath option and listed all i needed.
Thank you for the quick replies.