Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8119651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:51:42+00:00 2026-06-06T04:51:42+00:00

Using this C# application pick a start and ending date range, that SAP will

  • 0

Using this C# application pick a start and ending date range, that SAP will then use to do its query. I have made an application that passes one argument and it worked like that, but it does not work when doing two. Can anyone help?

C#

        private void button1_Click(object sender, EventArgs e)
        {
            String startDate = dateTimePicker1.Value.ToString("MM/dd/yyyy");
            String finishDate = dateTimePicker2.Value.ToString("MM/dd/yyyy");
            Process processbefore = new Process();
            processbefore.StartInfo.FileName = "C:\\Program Files\\SAP\\FrontEnd\\SAPgui\\saplogon.exe";
            processbefore.Start();
            processbefore.WaitForExit(1000 * 5 * 1);
            Process process = new Process();
            process.StartInfo.FileName = "C:\\Script2.vbs";
            process.StartInfo.Arguments = startDate;
            process.StartInfo.Arguments = finishDate;
            process.StartInfo.ErrorDialog = true;
            process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
            process.Start();
            process.WaitForExit(1000 * 60 * 10);    // wait up to 5 minutes.
        }
    }
}

Script2.vbs – VBScript (Abbreviated)

startDate = WScript.Arguments.Item(0)
finishDate = WScript.Arguments.Item(1)

I get a subscript out of range for the finishDate = WScript.Arguments.Item(1)

Rest of code after that. I need to know how to add another Argument to pass to the VBScript. I am getting an error if I just add another of the same line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:51:44+00:00Added an answer on June 6, 2026 at 4:51 am

    Instead of:

    process.StartInfo.Arguments = startDate;
    process.StartInfo.Arguments = finishDate;
    

    You want:

    process.StartInfo.Arguments = startDate + " " + finishDate;
    

    This is because arguments are space separated on Windows, and process.StartInfo.Arguments is a single string containing all the arguments.

    Note: if one of the arguments has a space in it, you need to place quotes around it or it will be interpreted as multiple arguments. For example:

    process.StartInfo.Arguments = "\"" + startDate + "\" \"" + finishDate "\"";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application for iphone that will pick an image from photo
I have the following requirements for an application that many people will be using
I am using this text editor for my windows forms application This works great
I deployed an application using this method and it worked very good. However, there
I am making a test fullscreen application using this guide . However, I am
This application is using windows integrated authentication in IIS. No anonymous login. It's also
In my application i am using this thread to rotate the Second hand on
I'm using this method to install an application, but it doesn't put the applications
I'm using this code inside WPF application: public static string EncryptString(string stringToEncrypt) { SHA256
i'm using this code to post to my application page: $page_info = $facebook->api(/344722062246773?fields=access_token); $attachment2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.