I am new to VB, and trying to implement a very simple procedure. I wish to rename all of the files in a given directory from *.txt extesions, to .csv extensions.
In a DOS command prompt, all I would need (after getting to the right directory) would be this line:
When the program is run, there will be a variable number of files in the directory.
What is the simplest way to do thi in VB.Net? For the life of me, I can't figure it out. This is the closest I've come:
but all this does is pop up the CMD prompt...the rename function doesn't run.
This is driving me crazy, because it should be (and probably is) so simple.
A many great thanks in advance for any help.
In a DOS command prompt, all I would need (after getting to the right directory) would be this line:
VB.NET:
rename *.txt *.
When the program is run, there will be a variable number of files in the directory.
What is the simplest way to do thi in VB.Net? For the life of me, I can't figure it out. This is the closest I've come:
VB.NET:
Dim Process As New System.Diagnostics.Process
Dim psi As ProcessStartInfo = New ProcessStartInfo
psi.FileName = "cmd.exe"
psi.WorkingDirectory = TextBox1.Text
psi.Arguments = "rename *.txt *.csv "
psi.CreateNoWindow = True
Process.StartInfo = psi
Process.Start()
but all this does is pop up the CMD prompt...the rename function doesn't run.
This is driving me crazy, because it should be (and probably is) so simple.
A many great thanks in advance for any help.