| 1. |
Solve : creating file from computer name? |
|
Answer» If someone can help me with this. OK I did itHow does this solve your problem? You said you needed to check if the computer name has HP in the name.This batch makes file with computername like mike10-HP.txt and second batch search for file with *-HP.txt if batch found that file than it makes backup, if not, than doesn't.This is another method which should work: Code: [Select]echo %computername%|findstr /e /i "-HP" >nul && (goto :backup) || (goto :FINISH) and this: Code: [Select]if /i "%computername:~-3%"=="-HP" (goto :backup) else (goto :finish)thank you, tihis one is better I will use it Quote from: Blisk on October 29, 2014, 08:42:15 AM This batch makes file with computername like mike10-HP.txtUgh! I guess you didn't bother to even research my ideas or even LOOK at all your old threads to accomplish this task. Quote from: Squashman on October 29, 2014, 01:51:33 PM Ugh! I guess you didn't bother to even research my ideas or even look at all your old threads to accomplish this task. No it is not that way, I have alot of work to do, so I don't have time now to sarch and learn how to do it so I found quickest way which worked. Quote from: Blisk on October 30, 2014, 01:34:26 AM No it is not that way, I have alot of work to do, so I don't have time now to sarch and learn how to do it so I found quickest way which worked.You are preaching to the choir, but that doesn't keep me from learning new scripting techniques every day. People will only want to give you the FISH so many times. Eventually you have to learn to FISH!unofrtunally everyone can't be fisherman, so thats why you have fish I have BREAD, you give me a fish I give you a bread! The basics I know but in reality what I do with fev lines or 2 batch files you can do with one line, because you have experiences. My work field is windows system and desktop, I use batch files just to make my job easier and I am not a programmer.I never saw you give him bread... Quote from: Blisk on October 30, 2014, 08:14:32 AM unofrtunally everyone can't be fisherman, so thats why you have fish I have bread, you give me a fish I give you a bread!Most Network System Administrators and Desktop Support people are not programmers but are at least required to know some kind of scripting language to automate tasks. I went to school 15 years ago and learning Batch on Windows and BASH on Unix was a requirement for my Network Administration degree. So it has nothing to do with being a programmer.yes you are right, what can I say. |
|