View Full Version : file found (hdd-windows path)
paul186
07-07-2008, 03:20 PM
hi im doing this action
found = File.Find(Shell.GetFolder(SHF_FONTS), "winlogon.exe", true, false);
if (found) then
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], false, "", 9, nil, false);
but i want that the file.find search winlogon.exe in the hdd/windows directory and not in the fonts path, how can i do it? i tough about C:/windows but theres some computers that is another letter different than c,for example D:/Windows...
is there any SHF_HDD? or SHF_Windows??
RizlaUK
07-07-2008, 03:35 PM
AMS has many built in variables for that kind of stuff
you can use
_WindowsFolder
inplace of
Shell.GetFolder(SHF_FONTS)
eg
found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
paul186
07-07-2008, 03:45 PM
thanks!!!! :)
SteevieNiteHeat
07-07-2008, 03:56 PM
hi im doing this action
found = File.Find(Shell.GetFolder(SHF_FONTS), "winlogon.exe", true, false);
if (found) then
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], false, "", 9, nil, false);
but i want that the file.find search winlogon.exe in the hdd/windows directory and not in the fonts path, how can i do it? i tough about C:/windows but theres some computers that is another letter different than c,for example D:/Windows...
is there any SHF_HDD? or SHF_Windows??
Sorry to interrupt & interfere, but winlogon.exe is NOT found in the fonts folder, it is in C:\windows\system32\
HTH :)
paul186
07-07-2008, 04:02 PM
yeah i know that winlogon is in system32 but now i have another problem,
with that code the program didt make a backup zip of this file...
it returns me the next error:
StatusDlg.Show(MB_ICONINFORMATION, false);
found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
if (found) then
Dialog.Message("Found one!", "The first PDF file found was:" .. found[1]);
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], "", 9, nil, false);
StatusDlg.Hide();
end
ERROR:
On show - line 29 argument 2 must be a type of string...
ithink its in the "found[1]" that returns me C:/Windows/system32/winlogon.exe instead of C\\windows... but i dont know how to change this syntax or if this the problem
SteevieNiteHeat
07-07-2008, 04:05 PM
yeah i know that winlogon is in system32 but now i have another problem,
with that code the program didt make a backup zip of this file...
it returns me the next error:
StatusDlg.Show(MB_ICONINFORMATION, false);
found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
if (found) then
Dialog.Message("Found one!", "The first PDF file found was:" .. found[1]);
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], "", 9, nil, false);
StatusDlg.Hide();
end
ERROR:
On show - line 29 argument 2 must be a type of string...
ithink its in the "found[1]" that returns me C:/Windows/system32/winlogon.exe instead of C\\windows... but i dont know hot to change that syntax or if is this the problem
Should it not be:
StatusDlg.Show(MB_ICONINFORMATION, false);
found = File.Find(_SystemFolder, "winlogon.exe", true, false);
if (found) then
Dialog.Message("Found one!", "The first PDF file found was:" .. found[1]);
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], "", 9, nil, false);
StatusDlg.Hide();
end
As this is the path?
sorry I cannot test this as I am not at my normal machine, and I dont have AMS on this 1
paul186
07-07-2008, 04:14 PM
--if the option of making backup is set to 1 (true) search file and make the backup, else do nothing
if tabText[7] == "1" then
StatusDlg.Show(MB_ICONINFORMATION, false);
found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
if (found) then
Dialog.Message("Found one!", "The first PDF file found was:" .. found[1]);
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], false, "", 9, nil, false);
StatusDlg.Hide();
end
else
end
i attach the 3 images of the dialogs, messages, and error
SteevieNiteHeat
07-07-2008, 04:16 PM
--if the option of making backup is set to 1 (true) search file and make the backup, else do nothing
if tabText[7] == "1" then
StatusDlg.Show(MB_ICONINFORMATION, false);
found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
if (found) then
Dialog.Message("Found one!", "The first PDF file found was:" .. found[1]);
Zip.Add("AutoPlay\\Docs\\backup.zip", found[1], false, "", 9, nil, false);
StatusDlg.Hide();
end
else
end
i attach the 3 images of the dialogs, messages, and error
As I said, I dont have AMS on this machine I am using at the moment, I am out in the cold, dark shed managing my server lol
I'm sure that somebody will help soon though
paul186
07-07-2008, 04:28 PM
dont work a lot and get hot! thanks anyway ;)
screwed over
07-07-2008, 06:05 PM
maybe it would help if you pointed out exactly which line is line 29. i know i cant find errors unless the exact line is oointed out by the debugger.
paul186
07-08-2008, 02:51 AM
maybe it would help if you pointed out exactly which line is line 29. i know i cant find errors unless the exact line is oointed out by the debugger.
here is the screenshoot of the code
RizlaUK
07-08-2008, 08:47 AM
its already telling you what the error is
remove the "[1]" from found in the zip add function, it requires a table and you passed 1 table item
paul186
07-08-2008, 12:02 PM
lol i was crazy for this error and that was only this thing... im silly!!!!!!!
lot of thanx RizlaUK now its fixed
RizlaUK
07-08-2008, 04:15 PM
lol, silly mistakes are vital to the learning process, now you know for next time
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.