Can't "echo" something?
I'm trying to get info from my computers. I'm using inifile.exe to check a setting in an ini file on every computer. When you run inifile.exe, its output is "set variablename=value", which can be run as a batch file to create a variable for the data.
What I'm trying to do is log that on the network. What I'm seeing is that the command doesn't show up in the PDQ Deploy output log:
echo %computername%,%variablename% >> \\servername\Share\filename.csv
It runs everything before that line, but that line and any lines after an echo command don't show up.
When I copy and paste the commands into a cmd prompt on my computer, it works just fine. PDQ Deploy just doesn't want to echo. How do I make it work or what else should I be using to get this information?
Comments
Can you provide a working example of what you are trying to accomplish? I think I can do this with Powershell which I know will log to Output.log and show up in the deployment console
OK, uh... Here's a sample of the full batch file with comments:
REM This reads the .ini file to find out what the variablename is.
REM The output of this command is "set variablename=value", which can run as a batch file
inifile.exe c:\path\settings.ini [section] variablename > temp.bat
temp.bat
REM Now that we've set the variable, I want to put it into a log in the network so that I can make sure it's the same across all of my computers.
echo %computername%,%variablename% >> \\servername\Share\filename.csv
That's everything. There are just three lines, and the third line doesn't work. I just don't understand why the third line doesn't work in PDQ Deploy when it does work from the command prompt. When I view the output log in PDQ deploy after deploying this command, I get the first two lines, and a third line that actually shows the "set variablename=value", but no "echo" of the thing to the place.
Coming back to my old thread because I found the time to find the answer.
Apparently my problem is not doing "call temp.bat" on line 2. If I run "temp.bat", it stops running anything after that. using "call" is my answer.