?
Solved

How best to re-write vbs script code wscript

Posted on 2013-11-14
3
Medium Priority
?
354 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 25

Expert Comment

by:chaau
ID: 39649698
What is your question?
0
 
LVL 5

Accepted Solution

by:
Dontmilkthis earned 2000 total points
ID: 39649737
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
ID: 39649782
Yep.  This is what I was looking for. Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 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