.NET

Reply
*pkirill
Message 1 of 1 (52 Views)

Command Line Args from Network File?

52 Views, 0 Replies
12-19-2005 08:39 AM

I've got a VB.NET application that converts PDFs to
TIFs. It works fine with all files using the dialog box interface, but I thought
I'd go crazy and add a right-click menu option. When I try this right click
option locally, it works just fine.  When I try in on a file located on the
network, it won't pick up the file name or path like it does from a local file.
Anyone have any tips for getting this to work?  the Command Line Arg
function I'm using is below...

 

Thanks for any help!

 


Module

subMain


Public frmSingleFile
As
color=#0000ff size=2>New
frmSingleFile


Public frmPDF2TIF
As
color=#0000ff size=2>New
frmPDF2TIF


Public CLA
color=#0000ff size=2>As

size=2>String


Public CLFolder
As
color=#0000ff size=2>String


 


Sub Main()


Dim x
color=#0000ff size=2>As

size=2>Integer


If
Len(GetCommandLineArgs(0)) > 0

size=2>Then


GetCommandLineArgs()


 


If
UBound(GetCommandLineArgs) > 0

size=2>Then


For x = 0
color=#0000ff size=2>To
UBound(GetCommandLineArgs)


CLA = CLA & " " & GetCommandLineArgs(x)


Next


MsgBox(CLA)           'for
testing


 


CLFolder = Trim(Left(CLA, InStrRev(CLA, "\")))


CLFolder = Right(CLFolder, Len(CLFolder) - 1)


'MsgBox(CLFolder)
color=#000000>   
'for
testing


End
color=#0000ff size=2>If


MsgBox(CLA)            'for
testing


MsgBox(CLFolder)    'for testing


frmSingleFile.ShowDialog()


Else


frmPDF2TIF.ShowDialog()


End
color=#0000ff size=2>If


End
color=#0000ff size=2>Sub


 


Public
color=#0000ff size=2>Function
GetCommandLineArgs()
As
color=#0000ff size=2>String
()


' Declare variables.


size=2>

Dim separators
As
color=#0000ff size=2>String
= " "


Dim commands
As
color=#0000ff size=2>String
=
Microsoft.VisualBasic.Command()


Dim args()
color=#0000ff size=2>As

size=2>String
= commands.Split(separators.ToCharArray)


Return args


End
color=#0000ff size=2>Function


End


size=2>Module

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.