/build/static/layout/Breadcrumb_cap_w.png

Custom Inventory Problems

Has anyone else been able to inventory .log files it %programfiles% directory? I've removed the variable (%programfiles(x86)%) thinking this might have caused some issues. I've used the full path. When I move this same .log file to ProgramData it returns the values. I need to keep it in program files since this data will be changing.

I'm able to run the command from CMD and it returns the correct values when in Progam Files. I have tried this with both 5.3.47657 & 5.3.53177.

I've used both of these.

ShellCommandTextReturn(cmd.exe /c type "%ProgramFiles(x86)%\WinMagic\SecureDoc-NT\UserData\sdjob.log")
ShellCommandTextReturn(cmd.exe /c type "C:\Program Files (x86)\WinMagic\SecureDoc-NT\UserData\sdjob.log")

1 Comment   [ + ] Show comment
  • Can you parse the text you want to return? I am only look to return one line. - JSenesap 7 years ago
    • I haven't tested, but you should be able to use "FIND".

      ShellCommandTextReturn(cmd.exe /c type "C:\Program Files (x86)\WinMagic\SecureDoc-NT\UserData\sdjob.log" | FIND "Your Text Here")

      http://ss64.com/nt/find.html - dugullett 7 years ago
      • Thanks, it worked. Exactly what I was looking to do. - JSenesap 7 years ago

Answers (1)

Answer Summary:
ShellCommandTextReturn(cmd.exe /c type \"C:\Program Files (x86)\WinMagic\SecureDoc-NT\UserData\sdjob.log")
Posted by: jknox 12 years ago
Red Belt
2

IIRC, it's a bug with the space in the argument.  You should be able to add escape characters to get it to work properly.

Something like this (added "\" in front of "C:"):

ShellCommandTextReturn(cmd.exe /c type \"C:\Program Files (x86)\WinMagic\SecureDoc-NT\UserData\sdjob.log")

You could also change C:\Program Files (x86) to C:\PROGRA~2 and I believe it would solve that also.


Comments:
  • Thanks that worked. I was hoping it was something easy. - dugullett 12 years ago

Don't be a Stranger!

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

Sign up! or login

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