Results 1 to 3 of 3

Thread: [RESOLVED] Passing an arguemtn to a new process with spaces

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Resolved [RESOLVED] Passing an arguemtn to a new process with spaces

    Hey,

    I have run into an interesting problem today and not sure how to work around it.


    In my program I use the Process.Start Method (String, String)

    http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx

    The file it is running is a VB Script and the argument is a path as to where the output file from the script will be save e.g "C:\Documents and Settings\rdlyma\Desktop\"

    I get the path in vb like this
    vb.net Code:
    1. Dim forlder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\MSU\test"

    Now instead of it taking the entire path as one argument, the path is broken up into arguments whereever there is a space. so "C:\Documents and Settings\rdlyma\Desktop\"
    become "C:\Documents" "and" "Settings\rdlyma\Desktop\"

    vb.net Code:
    1. if Wscript.Arguments.Count > 0 then
    2.                              xmlDoc.Save Wscript.Arguments(0) & ".xml"
    3.                            end if

    that is how it is used in the script
    Last edited by Crzyrio; May 13th, 2013 at 01:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width