none
Green horn would like some help? RRS feed

  • Question

  • Sorry if this is the Wrong thread to ask for assistance in scripting. Still learning the how to script process and was trying to throw a script together to pull some data from computer's that I can't access remotely due to ESET. My IT boss asked me to pull the data and compile it together so not hacking or anything like that. The script that I came up with so far seems to get hung on something and I have tried to search up a answer and have no luck.

    This is the script I came up with.

    @echo off
    echo Welcome please
    set /P input= "Type File Name "
    systeminfo < D:/"%input%".txt
    echo Please wait...
    echo Write was complete
    Pause

    Any help would be greatly appreciated. I will try and answer any question's as best as I can.


    • Edited by P.Milam Thursday, June 13, 2019 7:13 PM
    Thursday, June 13, 2019 7:13 PM

All replies

  • You should not start to learn cmd / batch because it is pretty much obsolete. Learn Powershell instead - that's much more powerful and actually easier to learn. If you insist to use cmd you should use ">" instead of "<". And to learn more about the tool you're about to use you should take a look at the help for the tool before you use it:  "systeminfo /?"

    When you post code here in the forum you should format it as code using the code posting tool provided on the icon bar of the post editor (second to last icon). Thanks.


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''


    • Edited by BOfH-666 Thursday, June 13, 2019 7:26 PM
    Thursday, June 13, 2019 7:25 PM
  • First you should not be using batch files.  Use PowerShell. It is easier, faster and easier to control.

    You also need to check your use of a redirector. You cannot input text into systeminfo.

    It is unclear what your file is supposed to do. What is in he file?

    If you want a list of computers then you have to use the "/S" parameter of the command.

    Please take the time to read the help for the program.

    systeminfo /?

    IN PowerShell just use "Get-ComputrInfo".  It produces a more useful report that can be easily printed or sent by email.


    \_(ツ)_/


    • Edited by jrv Thursday, June 13, 2019 7:31 PM
    Thursday, June 13, 2019 7:29 PM