tag:blogger.com,1999:blog-11049085.post6166518351339133429..comments2023-10-19T22:31:11.386+03:00Comments on Alex Pinsker: touch command for DOS/command lineAlex Pinskerhttp://www.blogger.com/profile/01712994496088023843noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-11049085.post-38207858838683816682013-03-27T04:26:04.919+02:002013-03-27T04:26:04.919+02:00Good One! Thanks!Good One! Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-80875264405618868002013-03-27T04:25:38.219+02:002013-03-27T04:25:38.219+02:00Good one!Good one!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-76654998393511735442013-03-27T04:25:08.480+02:002013-03-27T04:25:08.480+02:00Good one!Good one!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-48054375410512758452012-09-24T00:58:50.999+02:002012-09-24T00:58:50.999+02:00Gary's script works if there is no BLANK in th...Gary's script works if there is no BLANK in the filename, maybe he can improve it so it accepts BLANKS in the filenameAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-85234918683955041572011-08-31T01:09:41.971+03:002011-08-31T01:09:41.971+03:00Hey Read it before you use it!
What do you guess ...Hey Read it before you use it!<br /><br />What do you guess will %arg1% do?<br />Be happy it was not makeClean.bat you where using it. <br /><br />I think the idea of a wrapper is OK but:<br />why not just copy %* +,,<br /><br />The main trick is the "+,," thing, thanks for that!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-13930365766379224232011-08-16T18:18:31.758+03:002011-08-16T18:18:31.758+03:00Interesting... I used mytouch.cmd on a PowerPoint ...Interesting... I used mytouch.cmd on a PowerPoint document, and it opened the file. Of course, when I closed it, the timestamp had changed. (The simple copy command worked with no such interesting behavior.)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-89635171223765703102011-02-08T16:26:38.256+02:002011-02-08T16:26:38.256+02:00@echo off
rem Creates empty files
if not '%1&...@echo off<br />rem Creates empty files<br /><br />if not '%1'=='' goto loop<br /> echo Usage: touch file...<br /> echo creates empty files<br /> goto done<br /><br />:loop<br /> type nul >> %1<br /> shift<br /> if not '%1'=='' goto loop<br /><br />:done<br /><br /><br /><br /><br /><br />////////<br />Put the above code into a batch script. Place it in a file area for personal batch scripts. Call that file touch. Make sure the file area is on the system PATH or the local user PATH variable. Then you can use the command to make blank files.Unknownhttps://www.blogger.com/profile/06345824311252923623noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-32336788503193034082011-01-27T08:46:39.450+02:002011-01-27T08:46:39.450+02:00thanks. it's working.. But, how to make it to ...thanks. it's working.. But, how to make it to run for the whole folder?? Any idea?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-68575761307773612372010-12-16T01:36:29.185+02:002010-12-16T01:36:29.185+02:00Thanks - I took it and made a wrapper, mytouch.cmd...Thanks - I took it and made a wrapper, mytouch.cmd, which is in a folder in my PATH env var. If using on files with embedded spaces, just enclose the filename in quotes on the command line, it seems to work nicely:<br /><br />mytouch.cmd:<br /><br />@echo off<br />set arg1=%*<br />%arg1%<br />copy /b %arg1% +,,<br /><br /><br />SAMPLE USAGE:<br />mytouch "some old file.txt"<br /><br /><br />It simply results as you have indicated, in the file's datestamp being updated to current datetime.<br /><br />COOL. Thanks again for the simple syntax for the copy with "/b" flag.StephenFhttps://www.blogger.com/profile/08961661231948433663noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-8356903408450340662010-12-05T14:00:37.680+02:002010-12-05T14:00:37.680+02:00Thanks for the update, newbies still need to work ...Thanks for the update, newbies still need to work hard to get it done right ;)Server-Indiahttp://www.unichost.comnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-21226443495247051412009-05-13T14:27:00.000+03:002009-05-13T14:27:00.000+03:00The original command is updated; it's ok now.The original command is updated; it's ok now.Alex Pinskerhttps://www.blogger.com/profile/01712994496088023843noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-41829589516888535822009-05-12T22:55:00.000+03:002009-05-12T22:55:00.000+03:00When you copy NULL to a file, the file is still th...When you copy NULL to a file, the file is still there, but it's now empty. The file is not much use after that.wshatner32https://www.blogger.com/profile/01488285695287155249noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-23422361431524470742008-11-28T14:36:00.000+02:002008-11-28T14:36:00.000+02:00For me, the file size becomes 0. Anyway, the other...For me, the file size becomes 0. Anyway, the other command works fine.Matthttps://www.blogger.com/profile/15034221567313703969noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-3606748283834432052008-08-31T19:00:00.000+03:002008-08-31T19:00:00.000+03:00I just tried this command from the cmd line in Win...I just tried this command from the cmd line in Windows XP and it erased the file. The following command is working:<BR/><BR/>copy /b test.txt +,,Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11049085.post-1962591402400619982008-08-27T20:41:00.000+03:002008-08-27T20:41:00.000+03:00No, it doesn't erases that file, it just refreshes...No, it doesn't erases that file, it just refreshes the date.Alex Pinskerhttps://www.blogger.com/profile/01712994496088023843noreply@blogger.comtag:blogger.com,1999:blog-11049085.post-895051991562707332008-08-27T18:16:00.000+03:002008-08-27T18:16:00.000+03:00Ye, or....just erases the file!Ye, or....<BR/><BR/>just erases the file!Robert Campionhttps://www.blogger.com/profile/15520871182336666133noreply@blogger.com