Sign in to follow this  
Followers 0
kman

Searching for a file in mulitple OS's

4 posts in this topic

Hello everyone. Of course a newbie here but having fun. :)

I am trying to write a script that will just search for a particular file or will look in either the C:\WINNT or C:\WINDOWS folder depending on the OS it is running on. The idea is to see if a particular .ini file exists and if it doesnt then run an install of the designated program.

Any help would be appreciated. Thank you!!

Share this post


Link to post
Share on other sites



Welcome kman,

Just use FileExists for the known file.

If FileExists(@WindowsDir & '\Filename.ini') Then
    Run('setup.exe')
EndIf

No matter what the window folder is called, @Windowdir will hold the value of the path.

:)

Share this post


Link to post
Share on other sites

Hello everyone. Of course a newbie here but having fun. :)

I am trying to write a script that will just search for a particular file or will look in either the C:\WINNT or C:\WINDOWS folder depending on the OS it is running on. The idea is to see if a particular .ini file exists and if it doesnt then run an install of the designated program.

Any help would be appreciated. Thank you!!

Well,You could just substitute the directory with the @WindowsDir macro

MsgBox(0,"Windows Diectory", @WindowsDir)oÝ÷ Øêò¢ç(ºWn±ëayú'¶+©MjºèÂÊZËr

Share this post


Link to post
Share on other sites

Thank you so much for the replies!! I had been messing around with the FileExist before but was trying to use it for both directories. It was the @windowsDir that helped me!! Thanks again for everyones time!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0