|
![]() |
|
| Author |
|
|||||||
|
Space Ninja
Posts: 3260
Location: Brisbane, Queensland
|
Hey guys,
I'm just trying to write a small batch file here at the moment, but was wondering if anybody could help me out with a couple of problems I'm having. I'm trying to create a file which a user can run on their desktop, which puts a bunch of system relevant information into a text file and displays it back to them. What I'd like to do is write a batch file which grabs %username% and %computername% and dumps them to c:\computerinfo.txt and then executes notepad and displays it back to the user. I'm fine with all the variables etc but I'm wondering if anybody knows a way to pump the data from the raw command line to a text file? I thought it was something like | or print but I cannot remember and all the resources I find at the moment are for linux. On the same topic too, does anybody know the % variable for finding an IP address?? Thanks in advance if you can help me out or point me in the right direction! |
|||||||
| #0 04:46pm 19/04/06 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
Jim
Posts: 4241
Location: Brisbane, Queensland
|
redirect: >
redirect append: >> there's no variable I'm aware of for your ip addresses, but: http://www.ericphelps.com/batch/samples/ip.txt |
|||||||
| #1 04:52pm 19/04/06 |
|
|||||||
|
Space Ninja
Posts: 3261
Location: Brisbane, Queensland
|
champion!
thanks jim!! |
|||||||
| #2 04:53pm 19/04/06 |
|
|||||||
|
whoop
Posts: 9948
Location: Brisbane, Queensland
|
ipconfig >> ip.txt replace ip.txt with the name of your text file that you have the other crap in last edited by whoop at 18:14:50 19/Apr/06 |
|||||||
| #3 06:14pm 19/04/06 |
|
|||||||
|
system
|
--
|
|||||||
| #3 |
|
|||||||
|
| ||||||||