Problems executing a script

Comments

5 comments

  • Luke Nichols

    Mauro,

    Could you please export the PDQ Deploy package and post it here?

    1
    Comment actions Permalink
  • Mauro Barbacovi

    <?xml version="1.0" encoding="utf-8"?>
    <AdminArsenal.Export Code="PDQDeploy" Name="PDQ Deploy" Version="18.2.12.0" MinimumVersion="15.0">
    <Package>
    <CurrentLibraryPackageVersionId value="null" />
    <PackageDefinition name="Definition">
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>All</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <CopyMode>Default</CopyMode>
    <DelayedApprovalTimeSpan>7.00:00:00</DelayedApprovalTimeSpan>
    <DownloadApprovalMode>Manual</DownloadApprovalMode>
    <InventoryScanProfileId value="null" />
    <IsDownloadApprovalModeInherited value="true" />
    <ScanAfterDeployment value="null" />
    <Steps type="list">
    <CommandStep>
    <Command>"\\FEMPC0650\E\setup.exe" /Auto Upgrade /MigrateDrivers All /ShowOOBE none /Compat IgnoreWarning /Telemetry Disable</Command>
    <Files></Files>
    <SuccessCodes>0</SuccessCodes>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Bits64</Architecture>
    <Version>Windows10</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>NoLoggedOnUser</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title></Title>
    <TypeName>Command</TypeName>
    <IsEnabled value="false" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </CommandStep>
    <FileCopyStep>
    <AllowOverwrite value="false" />
    <CopyAllFiles value="false" />
    <FilePatternsText></FilePatternsText>
    <IgnoreOverwriteErrors value="false" />
    <IncludeSubFolders value="false" />
    <Mode>SingleFile</Mode>
    <Source>\\FEMPC0650\C$\Supporto\RemoveApp.ps1</Source>
    <Target>C:\</Target>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>All</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title>File Copy</Title>
    <TypeName>FileCopy</TypeName>
    <IsEnabled value="true" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </FileCopyStep>
    <CommandStep>
    <Command>\\fempc0650\c$\supporto\startps.cmd</Command>
    <Files></Files>
    <SuccessCodes>0</SuccessCodes>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>All</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title></Title>
    <TypeName>Command</TypeName>
    <IsEnabled value="true" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </CommandStep>
    </Steps>
    <Timeout value="60" />
    <UseCustomTimeout value="false" />
    <RunAs>Admin</RunAs>
    </PackageDefinition>
    <Description></Description>
    <NewLibraryPackageVersionId value="null" />
    <OriginalId value="null" />
    <Version></Version>
    <IsAutoDownload value="false" />
    <FolderId value="4" />
    <LibraryPackageVersionId value="null" />
    <Name>W10_1909</Name>
    <Path>Packages\Install\Experimental\W10_1909</Path>
    <PackageDisplaySettings name="DisplaySettings">
    <DisplayType>Normal</DisplayType>
    <IconKey>Icon-Package</IconKey>
    <SortOrder value="7" />
    </PackageDisplaySettings>
    </Package>
    </AdminArsenal.Export>

    1
    Comment actions Permalink
  • Luke Nichols

    Ok, thanks. Try this version, I disabled your steps and added my own. I consolidated your File Copy and Command steps as a single Install step:

    <?xml version="1.0" encoding="utf-8"?>
    <AdminArsenal.Export Code="PDQDeploy" Name="PDQ Deploy" Version="18.1.38.0" MinimumVersion="15.0">
    <Package>
    <CurrentLibraryPackageVersionId value="null" />
    <PackageDefinition name="Definition">
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>AllWorkstations</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <CopyMode>Default</CopyMode>
    <DelayedApprovalTimeSpan>7.00:00:00</DelayedApprovalTimeSpan>
    <DownloadApprovalMode>Manual</DownloadApprovalMode>
    <InventoryScanProfileId value="null" />
    <IsDownloadApprovalModeInherited value="true" />
    <ScanAfterDeployment value="null" />
    <Steps type="list">
    <CommandStep>
    <Command>"\\FEMPC0650\E\setup.exe" /Auto Upgrade /MigrateDrivers All /ShowOOBE none /Compat IgnoreWarning /Telemetry Disable</Command>
    <Files></Files>
    <SuccessCodes>0</SuccessCodes>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Bits64</Architecture>
    <Version>Windows10</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>NoLoggedOnUser</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title></Title>
    <TypeName>Command</TypeName>
    <IsEnabled value="false" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </CommandStep>
    <FileCopyStep>
    <AllowOverwrite value="false" />
    <CopyAllFiles value="false" />
    <FilePatternsText></FilePatternsText>
    <IgnoreOverwriteErrors value="false" />
    <IncludeSubFolders value="false" />
    <Mode>SingleFile</Mode>
    <Source>\\FEMPC0650\C$\Supporto\RemoveApp.ps1</Source>
    <Target>C:\</Target>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>All</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title>File Copy</Title>
    <TypeName>FileCopy</TypeName>
    <IsEnabled value="false" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </FileCopyStep>
    <CommandStep>
    <Command>\\fempc0650\c$\supporto\startps.cmd</Command>
    <Files></Files>
    <SuccessCodes>0</SuccessCodes>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>All</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title></Title>
    <TypeName>Command</TypeName>
    <IsEnabled value="false" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </CommandStep>
    <InstallStep>
    <CustomCommandLine></CustomCommandLine>
    <FileName>\\fempc0650\c$\supporto\startps.cmd</FileName>
    <Files>\\FEMPC0650\C$\Supporto\RemoveApp.ps1</Files>
    <IncludeDirectory value="false" />
    <LeaveInstallFile value="false" />
    <MsiOperation>Install</MsiOperation>
    <MsiQuiet value="true" />
    <MsiRestart>Never</MsiRestart>
    <Parameters></Parameters>
    <SuccessCodes>0,1641,3010,2359302</SuccessCodes>
    <RunAs value="null" />
    <Conditions type="list">
    <PackageStepCondition>
    <Architecture>Both</Architecture>
    <Version>AllWorkstations</Version>
    <TypeName>OperatingSystem</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <IsUserLoggedOn>AlwaysRun</IsUserLoggedOn>
    <TypeName>LoggedOnUser</TypeName>
    </PackageStepCondition>
    <PackageStepCondition>
    <ConditionMode>None</ConditionMode>
    <InventoryCollectionId value="null" />
    <InventoryCollectionName></InventoryCollectionName>
    <TypeName>Collection</TypeName>
    </PackageStepCondition>
    </Conditions>
    <ErrorMode>StopDeploymentFail</ErrorMode>
    <Title>Execute startps.cmd</Title>
    <TypeName>Install</TypeName>
    <IsEnabled value="true" />
    <IsPostStep value="false" />
    <IsPreStep value="false" />
    </InstallStep>
    </Steps>
    <Timeout value="60" />
    <UseCustomTimeout value="false" />
    <RunAs>Admin</RunAs>
    </PackageDefinition>
    <Description></Description>
    <NewLibraryPackageVersionId value="null" />
    <OriginalId value="null" />
    <Version></Version>
    <IsAutoDownload value="false" />
    <FolderId value="45" />
    <LibraryPackageVersionId value="null" />
    <Name>W10_1909</Name>
    <Path>Private Packages\PDQ Support Forums\W10_1909</Path>
    <PackageDisplaySettings name="DisplaySettings">
    <DisplayType>Normal</DisplayType>
    <IconKey>Icon-Package</IconKey>
    <SortOrder value="7" />
    </PackageDisplaySettings>
    </Package>
    </AdminArsenal.Export>

    0
    Comment actions Permalink
  • Mauro Barbacovi

    I am afraid that it isn.t working, there is some strange permissions problems, I am trying deploymentt toward a win 10 1703 (the idea is to update old machines and throw away appx garbage, after 1909 update). I ve tryed almost any combination, copying files on target and executing, using a share folder (in case some path problems), inserting command straight from comman line ... for an example if I call cmd on targed machine (no runas as administrator a simple cmd but with domain admin user) and I paste the cmd string, having ps1 script in correct place it works, no way with pdq deploy ...

     

    By the way I have seen just now that compacting in a single step makes cmd wrong, it is calling c:\removeapp.ps1 but now removeapp.ps1 is copyied in c:\windows\Admin Arsenal\ ... So I have removed C:\, but I dont know if cmd is accepting a relative path ... I used C:\ and two steps to be sure of invoking an existent file.

    1
    Comment actions Permalink
  • Chris

    Try using pathvariables instead of hardcoded paths in your scripts.

     

    For example (batch) for current path: %~dp0

    For example (powershell) for current script path: $PSScriptRoot

    For example (powershell) for C: : $env:SystemDrive

    etc..

    1
    Comment actions Permalink

Please sign in to leave a comment.