file found (hdd-windows path)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • paul186
    Forum Member
    • Jan 2006
    • 82

    file found (hdd-windows path)

    hi im doing this action

    Code:
    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
    Indigo Rose Customer
    • May 2006
    • 5552

    #2
    AMS has many built in variables for that kind of stuff

    you can use
    Code:
    _WindowsFolder
    inplace of
    Code:
    Shell.GetFolder(SHF_FONTS)
    eg
    Code:
    found = File.Find(_WindowsFolder, "winlogon.exe", true, false);
    Embrace change in your life, you never know, it could all work out for the best

    Comment

    • paul186
      Forum Member
      • Jan 2006
      • 82

      #3
      a

      thanks!!!!

      Comment

      • SteevieNiteHeat
        Forum Member
        • Jun 2008
        • 176

        #4
        Originally posted by paul186 View Post
        hi im doing this action

        Code:
        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

        Comment

        • paul186
          Forum Member
          • Jan 2006
          • 82

          #5
          yea

          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:

          Code:
          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

          Comment

          • SteevieNiteHeat
            Forum Member
            • Jun 2008
            • 176

            #6
            Originally posted by paul186 View Post
            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:

            Code:
            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:

            Code:
            StatusDlg.Show(MB_ICONINFORMATION, false);
            [B]	found = File.Find(_SystemFolder, "winlogon.exe", true, false);[/B]
            		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
            Last edited by SteevieNiteHeat; 07-07-2008, 03:08 PM.

            Comment

            • paul186
              Forum Member
              • Jan 2006
              • 82

              #7
              Code:
              --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
              Attached Files

              Comment

              • SteevieNiteHeat
                Forum Member
                • Jun 2008
                • 176

                #8
                Originally posted by paul186 View Post
                Code:
                --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

                Comment

                • paul186
                  Forum Member
                  • Jan 2006
                  • 82

                  #9
                  dont work a lot and get hot! thanks anyway

                  Comment

                  • screwed over
                    Forum Member
                    • Apr 2007
                    • 176

                    #10
                    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.

                    Comment

                    • paul186
                      Forum Member
                      • Jan 2006
                      • 82

                      #11
                      Originally posted by screwed over View Post
                      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
                      Attached Files

                      Comment

                      • RizlaUK
                        Indigo Rose Customer
                        • May 2006
                        • 5552

                        #12
                        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
                        Embrace change in your life, you never know, it could all work out for the best

                        Comment

                        • paul186
                          Forum Member
                          • Jan 2006
                          • 82

                          #13
                          lol i was crazy for this error and that was only this thing... im silly!!!!!!!

                          lot of thanx RizlaUK now its fixed

                          Comment

                          • RizlaUK
                            Indigo Rose Customer
                            • May 2006
                            • 5552

                            #14
                            lol, silly mistakes are vital to the learning process, now you know for next time
                            Embrace change in your life, you never know, it could all work out for the best

                            Comment

                            Working...
                            X