WARNING #7005

    Parameters (if any) must be set using the Arguments property of ProcessStartInfo

    Description

    This Warning appears when you are migrating a Shell call, and it means that the way that parameters are passed to a process in .Net is different than the VB6's.

    Recommendations

    If you need to pass parameters to a command being executed by a Shell, split the command and the arguments in this way:

    ProcessStartInfo startInfo = newProcessStartInfo("command");

    startInfo.Arguments = parameters;

    Sample VB6

    PublicSub ExcecuteCmd(ByVal parameters AsString)
          Shell("command " & parameters, vbMaximizedFocus)
    EndSub

    Target VB.NET

    PublicSub ExcecuteCmd(ByVal parameters AsString)
         'UPGRADE_WARNING: (7005) parameters (if any) must be set using the Arguments property of ProcessStartInfo
         Dim startInfo As ProcessStartInfo = New ProcessStartInfo("command " & parameters)
         startInfo.WindowStyle = ProcessWindowStyle.Maximized
         Process.Start(startInfo)
    EndSub

    Target C#

    publicvoid ExcecuteCmd( string parameters)
    {
           //UPGRADE_WARNING: (7005) parameters (if any) must be set using the Arguments property of ProcessStartInfo
           ProcessStartInfo startInfo = newProcessStartInfo("command " + parameters);
           startInfo.WindowStyle = ProcessWindowStyle.Maximized;
           Process.Start(startInfo);
    }


    Download VBUC Free Trial
    Download VBUC Now

    It's time to eradicate VB6
    ROI of eradicating VB6

    8 Proven Tips for
    Planning a Successful Migration

    8 Tips for migration