How do I send cmd line results as a txt file

waterpleb

Distinguished
Oct 19, 2014
10
0
18,560
How do I send a cmd line info to the desktop as a txt file. I have windows 7 and have tried this syntax. Ipconfig >%userprofile%\desktop\info.txt. and it is not working. I have tried running it as administrator. I know the syntax works as I tried it at work on windows 8 and it works fine. Am I doing something wrong? Thanks.
 

waterpleb

Distinguished
Oct 19, 2014
10
0
18,560


nah Isnt .bat file used for batch files? . I want the information sent to a text file which it is doing.That part is right. I just cannot get it to go to my desktop. it works fine at work, the same cmd lines send the ipconfig info to the deskop in text fomat. It doesnt work at home for some reason.
 

waterpleb

Distinguished
Oct 19, 2014
10
0
18,560

I also get the access denied message when I try to send it to the desktop on windows 7. The exact syntax works fine on windows 8 and sends it to the desktop.
On windows 7, if I leave out the word deskop , it will output the file to a text file and I can find it by searching for it by name. I dont undestand why I cannot send it to the desktop.
There has to be a cmd line syntax that will work.
 

waterpleb

Distinguished
Oct 19, 2014
10
0
18,560


ok I got it.
Ipconfig >%userprofile%\desktop\info.txt. This works on windows 8. on windows 7 you get an access denied message.

To send a cmd line output to the desktop on windows 7 use this.

ipconfig>desktop\filename.txt

this works, yay!

(funnily enough not when running cmd prompt as admin thought.)
thanks for the replies.