6 Replies Latest reply on Dec 11, 2008 9:46 AM by scottunify

    Custom script not creating defrag logfile

    Apprentice

      Hi all

       

      We will soon be rolling out full disk encryption software to all laptops and our supplier have advised us to ensure all machines that require a defrag, are defragged.  So with that in mind, we created a custom LANDesk script to, initially, defrag analyse each machine and pipe the logfile to a server share as follows:-

       

      [MACHINES]
      remexec0=defrag c: -a -v >\\server\share\%computername%.log

       

      The defrag analysis works fine but the logfile is not created on the server share.  We've checked NTFS permissions and also changed the command line to created the logfile locally (for testing purposes) but still the custom script will not create the logfile:-

       

      [MACHINES]
      remexec0=defrag c: -a -v >C:\%computername%.log 

       

      We have also manually run the command line in a cmd prompt running as the LocalSystem account to emulate a LANDesk script/package and it does work.  So why does it not work within our LANDesk custom script please?

       

      Thanks

      Scott

        • 1. Re: Custom script not creating defrag logfile
          ahe Expert

          Hello Scott,

           

          I think it depends on your script syntax... I fear the letter ">" is not allowed...

           

          I prefer a start of a batch file with custom scripts...

           

          See this threads/docs:

          http://community.landesk.com/support/message/2819#2819

          http://download.landesk.com/support/eol/mgtsuite6.4/customscripts.pdf

          http://community.landesk.com/support/docs/DOC-2320

           

          Regards

          Axel

          • 2. Re: Custom script not creating defrag logfile
            Apprentice

            Hi

             

            We have moved from a custom script to the following batch file distribution package:-

             

            SET Logfile=\\server\share\CheckPoint\Chkdsk\Logfiles\%computername%.log
              C:\WINDOWS\system32\chkdsk.exe > %Logfile%

             

            The logfile is created on the server share but the package fails on the server with the message "the system cannot find the path specified".  Nornmally, I'd be able to resolve this seemingly simple issue but it has baffled me this time. I can access the server path from the client, not that I should need to because the package created the logfile on the server share (!).

             

            Here's the sdclient logfile:-

             

             

            Fri, 05 Dec 2008 16:27:24 File (\\server\share\CheckPoint\Chkdsk\chkdsk.bat) is not in cache
            Fri, 05 Dec 2008 16:27:26 WM_CREATE
            Fri, 05 Dec 2008 16:27:26 WM_STARTCLIENT
            Fri, 05 Dec 2008 16:27:27 Downloading file 1 of 1 from '\\server\share\CheckPoint\Chkdsk\chkdsk.bat'
            Fri, 05 Dec 2008 16:27:27 Batch file Client Thread
            Fri, 05 Dec 2008 16:27:27 PackagePath: [\\server\share\CheckPoint\Chkdsk\chkdsk.bat]
            Fri, 05 Dec 2008 16:27:27 WinNT
            Fri, 05 Dec 2008 16:31:08 Setting status for batch file to 3
            Fri, 05 Dec 2008 16:31:08 Batch file status of 3 obtained from shared memory
            Fri, 05 Dec 2008 16:31:08 treating status as win32 HRESULT, updated value 8007000308x
            Fri, 05 Dec 2008 16:31:08 Bat file output :
            C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>call "C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk\chkdsk.bat"
            C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>SET Logfile=\\server\share\CheckPoint\Chkdsk\Logfiles\LAP1280.log
            C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>C:\WINDOWS\system32\chkdsk.exe  1>\\server\share\CheckPoint\Chkdsk\Logfiles\LAP1280.log
            C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>"C:\Program Files\LANDesk\LDClient\sdclient.exe" /setbatchstatus=3
            Fri, 05 Dec 2008 16:31:08 Installation result 80070003
            Fri, 05 Dec 2008 16:31:08 processing of package is complete, result -2147024893 (0x80070003 - code 3)

             


            Can anyone explain why "the system cannot find the path specified" please?

             

            Thanks

            Scott

            • 3. Re: Custom script not creating defrag logfile
              MarXtar ITSMMVPGroup

              If this is being launched as the local system account then it wouldn't have rights to create anything in that directory.  Can you set this to run under the rights of the logged in user?

               

              Mark Star - MarXtar LANDesk Enhancements

              Home of Power State Notifier & Wake-On-WAN for LANDesk

              • 4. Re: Custom script not creating defrag logfile
                Apprentice

                I have just tried your suggestion by inserting the StartAsUser.exe command but I get the same error.  Here's the logfile:-

                 

                 

                Fri, 05 Dec 2008 17:12:34 File (\\server\share\CheckPoint\Chkdsk\chkdsk.bat) is not in cache
                Fri, 05 Dec 2008 17:12:36 WM_CREATE
                Fri, 05 Dec 2008 17:12:36 WM_STARTCLIENT
                Fri, 05 Dec 2008 17:12:38 Downloading file 1 of 1 from '\\server\share\CheckPoint\Chkdsk\chkdsk.bat'
                Fri, 05 Dec 2008 17:12:38 Batch file Client Thread
                Fri, 05 Dec 2008 17:12:38 PackagePath: [\\server\share\CheckPoint\Chkdsk\chkdsk.bat]
                Fri, 05 Dec 2008 17:12:38 WinNT
                Fri, 05 Dec 2008 17:12:38 Setting status for batch file to 3
                Fri, 05 Dec 2008 17:12:38 Batch file status of 3 obtained from shared memory
                Fri, 05 Dec 2008 17:12:38 treating status as win32 HRESULT, updated value 8007000308x
                Fri, 05 Dec 2008 17:12:38 Bat file output :
                C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>call "C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk\chkdsk.bat"
                C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>SET Logfile=\\server\share\CheckPoint\Chkdsk\Logfiles\LAP1280.log
                C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>\\server\share\CheckPoint\Chkdsk\StartAsUser.exe C:\WINDOWS\system32\chkdsk.exe  1>\\server\share\CheckPoint\Chkdsk\Logfiles\LAP1280.log
                C:\Program Files\LANDesk\LDClient\sdmcache\swpackages\CheckPoint\Chkdsk>"C:\Program Files\LANDesk\LDClient\sdclient.exe" /setbatchstatus=3
                Fri, 05 Dec 2008 17:12:38 Installation result 80070003
                Fri, 05 Dec 2008 17:12:38 processing of package is complete, result -2147024893 (0x80070003 - code 3)
                • 5. Re: Custom script not creating defrag logfile
                  Apprentice

                  ...the error even occurs when I created the logfile locally on the machine, with or without StartAsUser.exe:-

                   

                  mkdir C:\Chkdsk
                    SET Logfile=C:\Chkdsk\%computername%.log
                    C:\WINDOWS\system32\chkdsk.exe > %Logfile%

                   

                  OR

                   

                  mkdir C:\Chkdsk
                    SET Logfile=C:\Chkdsk\%computername%.log
                    \\server\share\CheckPoint\Chkdsk\StartAsUser.exe C:\WINDOWS\system32\chkdsk.exe > %Logfile%

                   

                   

                  Any ideas please?

                   

                  Thanks

                  Scott

                  • 6. Re: Custom script not creating defrag logfile
                    Apprentice

                    We're still perplexed as to why we can run the batch files fine but when deploying as a LANDesk package the final status message is "the system cannot find the specified file", despite the batch file running successfully (!!!).

                     

                    Not ideal but to overcome this, we appended EXIT /B 0 to the end of the script to force the final status message to "Done - No error".  So far so good...

                     

                    Thanks all for your help/advice.

                     

                    Scott