/build/static/layout/Breadcrumb_cap_w.png

Customer Inventory Rule Help

What I'm trying to do is

If only software.exe exists only then run the command line to pull the last modified date of the dll file. 
This script below works but it posts the results from every computer.
ShellCommandtextreturn(cmd.exe /c FOR %A IN ("%ProgramFiles(x86)%\Solo\WS.dll") DO @ECHO=%~tA)

I want it to only run if the software exists on the computer. 

I'm looking for something like this below but it didn't work for me. 

ShellCommandtextreturn(if EXIST "%ProgramFiles(x86)%\SalesPad.GP\SalesPad.exe" 
cmd.exe /c FOR %A IN ("%ProgramFiles(x86)%\SalesPad.GP\SalesPad.Module.CCHSalesTaxOnlineWS.dll") DO @ECHO=%~tA)



0 Comments   [ + ] Show comments

Answers (2)

Posted by: SMal.tmcc 8 years ago
Red Belt
2
ShellCommandtextreturn(cmd /c if EXIST "%ProgramFiles(x86)%\SalesPad.GP\SalesPad.exe" FOR %A IN ("%ProgramFiles(x86)%\SalesPad.GP\SalesPad.Module.CCHSalesTaxOnlineWS.dll") DO @ECHO=%~tA)


any shell command to test open a cmd window and paste the portion after the /c

if EXIST "%ProgramFiles(x86)%\SalesPad.GP\SalesPad.exe" FOR %A IN ("%ProgramFiles(x86)%\SalesPad.GP\SalesPad.Module.CCHSalesTaxOnlineWS.dll") DO @ECHO=%~tA

and see if that works correctly
Posted by: chucksteel 8 years ago
Red Belt
2

Why not just use FileInfoReturn(C:\Program Files(x86)\Solo\WS.dll, ModifiedDate, date)?

If the computer doesn't have the file then it won't show up in the list of custom inventory fields. 


Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ