system files

mazza

Registered User.
Local time
Today, 12:55
Joined
Feb 9, 2005
Messages
101
I run a vb script that finds and delete files. This works fine as long as the directory is correct. The problem is that I have users who uses different language versions of windows.
The english version is C:\program files
The German is C:\programme
etc


Can I use s System directory name that replaces C:\program files in my path

This is my script.


Sub Main()

If My.Computer.FileSystem.FileExists("C:\Program Files\Compair service management\sqsv2.mdb") Then

'My.Computer.FileSystem.DeleteFile("C:\Program Files\Compair service management\sqsv2.mdb", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin, FileIO.UICancelOption.ThrowException)

Else
MsgBox("Your SQS file is not in the default location. Please after the installation you must move SQSv2.MDB to the correct location. The system will install the update in c:\program files\compair service management\")
End If
If My.Computer.FileSystem.FileExists("C:\Program Files\Compair service management\sqsv2update.mdb") Then

My.Computer.FileSystem.DeleteFile("C:\Program Files\Compair service management\sqsv2update.mdb", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin, FileIO.UICancelOption.ThrowException)
Else
MsgBox("Your SQS Update file is not in the default location. Please after the installation you must move SQSv2Update.MDB to the correct location. The system will install the update in c:\program files\compair service management\")
End If

End Sub
 
The Environ() function will give you want you want.

MsgBox Environ("ProgramFiles")

Search around for there are samples of all the Environ properties you can grab from the users computer.
 

Users who are viewing this thread

Back
Top Bottom