Hi,
Thanks for any help in advance. I am using vb.net in visual studio 2008.
here is my delima. From my program I would like to call a function that grabs all file names in a certain folder and I would like to pass them to a text file. I am able to do this from the command prompt line outside of my program from within the folder itself.

The folder is always changing and it is passed by a variable named strPath.

I would like when the shell opens to automaticaly be in this directory.
So i am playing around with it and so far I have

StrPath being the path that the user specifies to be looking in.

Dim commandstring As String = "" & strPath & " /b *.model > myjunkystuff.txt"
                    Dim cmdExeID As Integer = Shell("CMD """ & commandstring & """") ', AppWinStyle.Hide)

However, this isn't working for me.

Recommended Answers

All 2 Replies

Hi

I'll start you off in the right direction, look up the System.IO class

I appreciate your suggestion, however I am already using this approach and I need to implement a command prompt approach as well. I am getting an error in a file name that has a | which throws off the get files method. I need to be able to copy the files names to a text file from within the command line so I can find this error.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.