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")
Answer Summary:
ShellCommandTextReturn(cmd.exe /c type \"C:\Program Files (x86)\WinMagic\SecureDoc-NT\UserData\sdjob.log")
1 Comment   [ - ] Hide Comment


  • Can you parse the text you want to return? I am only look to return one line.
    • 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")

      • Thanks, it worked. Exactly what I was looking to do.
Please log in to comment

Answer this question or Comment on this question for clarity



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.

Answered 09/05/2012 by: jknox
Red Belt

  • Thanks that worked. I was hoping it was something easy.
Please log in to comment