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.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
n1mdas
Posts: 22
Last visit: Sat Dec 05, 2020 2:51 pm

VBS to exe using PrimalScript 2018 arguments

Post 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,
User avatar
Alexander Riedel
Posts: 8472
Last visit: Mon Mar 18, 2024 2:59 pm
Answers: 19
Been upvoted: 37 times

Re: VBS to exe using PrimalScript 2018 arguments

Post 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?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
n1mdas
Posts: 22
Last visit: Sat Dec 05, 2020 2:51 pm

Re: VBS to exe using PrimalScript 2018 arguments

Post 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,
Last edited by n1mdas on Wed Jun 13, 2018 12:17 pm, edited 1 time in total.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: VBS to exe using PrimalScript 2018 arguments

Post by jvierra »

Just pass the arguments to the EXE. It works just like the VBS.
User avatar
n1mdas
Posts: 22
Last visit: Sat Dec 05, 2020 2:51 pm

Re: VBS to exe using PrimalScript 2018 arguments

Post 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.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked