Saved Bookmarks
| 1. |
Solve : re-archiving a file without...? |
|
Answer» Quote from: Ocalabob on April 11, 2013, 12:00:47 PM Using WIN7 from a command prompt the line below worked for me: I tested that and it puts "ECHO is off" inside the file. This also works to change the archive attribute but appends a blank line. Maybe the teacher expects the file to be modified, but that's not in the spirit of the task. Code: [Select]echo.>>FOOT-PRO.TMS We still haven't solved this conundrum without moving or copying the file. Quote from: foxidrive on April 12, 2013, 01:38:09 AM Maybe the teacher expects the file to be modified, but that's not in the spirit of the task. I'd argue that GIVING stupid tasks with trick answers isn't in the spirit of learning.I agree. But I figured out a solution. Code: [Select]echo e|edlin /b foot-pro.tms >nul Cons are that it creates a .BAK file, ADDS an EOF marker and isn't meant to handle binary files.Also Edlin is not available on most default installs. Actually I don't think it works Post DOS5 edlin is a default utility in Windows 8 where I tested this. It's also in a default Win7 install, and a W2k install and is in my XP install.I think I figured it out: it's only available on 32-BIT Versions of the OS. which is why I do not have it on my 64-bit Windows 8 or Windows 7. chophillies will have to comment if they have 64 bit systems. edlin and debug are 16 bit tools so don't work in 64 bit systems. debug will write the file too and change the archive bit.Powershell's Set-ItemProperty can set / unset attribute bits, but this is not fundamentally different from using the ATTRIB command, is it? COMPUTERS on campus run windows 7 64 bit. Most 32 bit os have been replaced on campus with the exception of a couple servers i use as vms for my networking class. There i can access a 32bit version of xp. Since the command line course is also available to take exclusively online, i believe the solution she had in mind would probobly not be restricted to the type of os the student is using. Not every student who takes the command line course is required to take the networking course therefore any student with a more modern 64 bit os would be left hanging. I cant wait till class tuesday to find out her magic answerI tried piping echo across to SET /P and redirecting but that still wrote a new line and I also tried redirecting nul into set /p and redirecting that to the output file but that didn't work either. I can't think of anything else to try. >>foo.txt echo.|set /p.= >foo.txtThought the compact command might work but still a no go.Quote from: chophillies on April 12, 2013, 12:26:32 PM I cant wait till class tuesday to find out her magic answerPlease update us on the Magic Answer I believe 2 things... A) The instructer is either cruel...or an idiot... B) This exercise won't produce any good grade no matter what result but you'll probably do WELL on the amount of research... |
|