Solved

How best to re-write vbs script code wscript

Posted on 2013-11-14
3
340 Views
Last Modified: 2013-11-14
I need to try to get this to work in a vs 2012 project, I have the following segments.  I'm not sure I understand what wscript does, here are the example pieces.

objArgs = wscript.Arguments
        If (objArgs.Count = 2) Then
            DirName = CStr(objArgs(0))
            ReadingDate = CDate(objArgs(1))
        ElseIf (objArgs.Count = 1) Then
... code here

    FileSys = wscript.CreateObject("Scripting.FileSystemObject")

Open in new window

0
Comment
Question by:UnderSeven
3 Comments
 
LVL 24

Expert Comment

by:chaau
Comment Utility
What is your question?
0
 
LVL 5

Accepted Solution

by:
Dontmilkthis earned 500 total points
Comment Utility
If you're asking what the 'wscript' object is within vbscript, you can read a little about it on MSDN - http://msdn.microsoft.com/en-us/library/at5ydy31(v=vs.84).aspx

It is basically a global variable that's used interact with the scripting engine.

The most useful things wscript can do is:
Provide access to the arguments/parameters used when calling the script
Output to the console
initialise various system level object types

I don't know of a related object in VB.net. the functionality is split throughout the .Net libray.

for the two uses in your snippet.
arguments can be obtained from
My.Application.CommandLineArgs

Open in new window


the file system object (Scripting.FileSystemObject) functionality can be found within the System.IO namespace.
0
 

Author Closing Comment

by:UnderSeven
Comment Utility
Yep.  This is what I was looking for. Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now