Ok I have a (hopefully) simple question involving batch files, as my .bat skills have diminished since my Windows 3.1/Duke3D startup menus I used to make.
I am trying to make a .bat file to output the DELL service tag (using their sm_info.exe tool) to a text file, and then rename that text file to the machine's hostname.
Something along the lines of:
sm_info.exe > temp.txt
hostname.exe > temp2.txt ( output hostname command to a variable or text file )
ren temp.txt %variable%.txt
(I realize that would not work - just a guideline for what I'm trying to do)
Outputting the sm_info.exe to a text file is working fine, I just cannot figure out how to name that text file after the machine's hostname.
I know it's got to be something simple but it is driving me crazy. How do I rename a file after the machine's hostname?
Question
Dudlington
Ok I have a (hopefully) simple question involving batch files, as my .bat skills have diminished since my Windows 3.1/Duke3D startup menus I used to make.
I am trying to make a .bat file to output the DELL service tag (using their sm_info.exe tool) to a text file, and then rename that text file to the machine's hostname.
Something along the lines of:
sm_info.exe > temp.txt
hostname.exe > temp2.txt ( output hostname command to a variable or text file )
ren temp.txt %variable%.txt
(I realize that would not work - just a guideline for what I'm trying to do)
Outputting the sm_info.exe to a text file is working fine, I just cannot figure out how to name that text file after the machine's hostname.
I know it's got to be something simple but it is driving me crazy. How do I rename a file after the machine's hostname?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts