VBS to exe using PrimalScript 2018 arguments

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
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.
Locked
User avatar
n1mdas
Posts: 11
Joined: Thu Dec 28, 2017 2:05 pm

VBS to exe using PrimalScript 2018 arguments

Post by n1mdas » Tue Jun 12, 2018 10:50 am

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,

User avatar
Alexander Riedel
Posts: 6685
Joined: Tue May 29, 2007 4:43 pm

Re: VBS to exe using PrimalScript 2018 arguments

Post by Alexander Riedel » Tue Jun 12, 2018 10:55 am

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?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
n1mdas
Posts: 11
Joined: Thu Dec 28, 2017 2:05 pm

Re: VBS to exe using PrimalScript 2018 arguments

Post by n1mdas » Tue Jun 12, 2018 9:51 pm

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,
Last edited by n1mdas on Wed Jun 13, 2018 12:17 pm, edited 1 time in total.

User avatar
jvierra
Posts: 12895
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: VBS to exe using PrimalScript 2018 arguments

Post by jvierra » Tue Jun 12, 2018 10:56 pm

Just pass the arguments to the EXE. It works just like the VBS.

User avatar
n1mdas
Posts: 11
Joined: Thu Dec 28, 2017 2:05 pm

Re: VBS to exe using PrimalScript 2018 arguments

Post by n1mdas » Wed Jun 13, 2018 12:19 pm

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.

Locked