Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How best to re-write vbs script code wscript

Posted on 2013-11-14
3
Medium Priority
?
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

618 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