Kaseya Community

%systemdrive% and #systemdrive#

  • In one of the sample scripts created to do a disk defrag, the command to run the actual defrag is:

    %windir%\system32\defrag.exe %systemdrive% -f -v >> #systemdrive#\temp\defrag.txt

    Before this step, a variable was set to "systemdrive" by obtaining the Client Install Drive.

    However, it is unclear to me if the two are the same and would always be the same.

    Is %systemdrive% a set variable that is available to us to use in the script? If so, if the actual system drive was D: but the client was installed on C:, then this would not be the same, correct?


    Thanks.
    Vince


    Legacy Forum Name: %systemdrive% and #systemdrive#,
    Legacy Posted By Username: vplaza
  • your correct... in this sample I am combining 2 different ways of pulling variables. One using the windows variables and the other using the kaseya system scripting

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: sourceminer
  • Thanks.

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: vplaza