Page 1 of 1

VBS to exe using PrimalScript 2018 arguments

Posted: Tue Jun 12, 2018 10:50 am
by n1mdas
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,

Re: VBS to exe using PrimalScript 2018 arguments

Posted: Tue Jun 12, 2018 10:55 am
by Alexander Riedel
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?

Re: VBS to exe using PrimalScript 2018 arguments

Posted: Tue Jun 12, 2018 9:51 pm
by n1mdas
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,

Re: VBS to exe using PrimalScript 2018 arguments

Posted: Tue Jun 12, 2018 10:56 pm
by jvierra
Just pass the arguments to the EXE. It works just like the VBS.

Re: VBS to exe using PrimalScript 2018 arguments

Posted: Wed Jun 13, 2018 12:19 pm
by n1mdas
Just pass the arguments to the EXE. It works just like the VBS.
So many scripts and got confused.

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.