#142132 - 2005-06-22 01:19 AM
search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
hi there
i am looking desperately for a command that searches for a file on a specific drive i.e. C:
All i have is default\doc.dot but that can be anywhere under C:
so what i need to do is to find the whole path of default\doc.dot under that C: drive which maybe looks like that at the end: C:\test\123\default\doc.dot
C:\test\123\default\ should be a variable at the end which i can use to copy new files into it
complicated?
|
|
Top
|
|
|
|
#142134 - 2005-06-22 01:37 AM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
thx
thats what i tried the last 30 minutes...
UDF GetFilePath
but i am not getting the result i wish... 
maybe its just too late ... 1:30am
in a batch file i would use the command "for" for that function... is there a similar function for kix`?
Edited by msigi123 (2005-06-22 01:50 AM)
|
|
Top
|
|
|
|
#142137 - 2005-06-22 09:06 AM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
in my case i need to do updates on a application that you just copy into any folder under i.e. C: the application itself only need its own root path and the files in the subfolders to run...
at the same time thats the tricky part.. so i need to find first the path of this program and after that i can copy and overwrite the old files..
luckily the rootfolder, filenames and the subfolder structure is always the same... so i actually need to look for "root\appl.exe" anywhere on the C: if found the script should give me the path back
anyone able to give me a hint for this?
|
|
Top
|
|
|
|
#142139 - 2005-06-22 12:10 PM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
guess you have a master degree in social behavior...
thanks for your friendliness
|
|
Top
|
|
|
|
#142141 - 2005-06-22 01:34 PM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
i admitt i am not having sufficient knowhow with kix yet... i am a starter and thats the reason why i post this message here ("When you are new to KiXtart, you can post your questions here")
to find somebody experienced who can help me...
just remember your time as a starter... if it makes you angry please ignore the "starters" forum and look for something more sophisticated for you...
|
|
Top
|
|
|
|
#142143 - 2005-06-22 02:02 PM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
well batch is easy
C: cd\ dir file.exe /s
and i will get a list of all file.exe under C:
|
|
Top
|
|
|
|
#142146 - 2005-06-22 03:14 PM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
well actually the whole application is a VBA piece in winword. so there are no ini, reg-keys or anything else... unfortunately...
i know i wrote app.exe in the earlier posts.. that was my fault... there are only docs dots xls and mdb...
completely independent on where they are located
and every user copied it somwhere on the harddrive as it was introduced... now as we have updates we first need to locate where it is to replace the files
|
|
Top
|
|
|
|
#142148 - 2005-06-22 07:08 PM
Re: search for a file and write its path to a variable when found
|
msigi123
Fresh Scripter
Registered: 2005-06-22
Posts: 8
|
i agree with you about standards.. ;-)
nope.. i went back to batch scripts.. and it is working... thanks anyways
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|