Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: re-archiving a file without...  (Read 9172 times)

0 Members and 1 Guest are viewing this topic.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: re-archiving a file without...
« Reply #15 on: April 12, 2013, 01:38:09 AM »
Using WIN7 from a command prompt the line below worked for me:

Code: [Select]
echo>>FOOT-PRO.TMS

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. :)

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: re-archiving a file without...
« Reply #16 on: April 12, 2013, 01:43:27 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 was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: re-archiving a file without...
« Reply #17 on: April 12, 2013, 01:46:52 AM »
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.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: re-archiving a file without...
« Reply #18 on: April 12, 2013, 02:02:08 AM »
Also Edlin is not available on most default installs. Actually I don't think it works Post DOS5 :(
I was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: re-archiving a file without...
« Reply #19 on: April 12, 2013, 02:34:19 AM »
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.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: re-archiving a file without...
« Reply #20 on: April 12, 2013, 03:26:20 AM »
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.
I was trying to dereference Null Pointers before it was cool.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: re-archiving a file without...
« Reply #21 on: April 12, 2013, 03:55:18 AM »
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.

Salmon Trout

  • Guest
Re: re-archiving a file without...
« Reply #22 on: April 12, 2013, 04:33:24 AM »
Powershell's Set-ItemProperty can set / unset attribute bits, but this is not fundamentally different from using the ATTRIB command, is it?



chophillies

    Topic Starter


    Greenhorn

    • Experience: Familiar
    • OS: Windows 7
    Re: re-archiving a file without...
    « Reply #23 on: April 12, 2013, 12:26:32 PM »
    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 answer

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: re-archiving a file without...
    « Reply #24 on: April 12, 2013, 01:06:29 PM »
    I 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.=
    <nul set /p.=>>foo.txt

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: re-archiving a file without...
    « Reply #25 on: April 12, 2013, 01:26:35 PM »
    Thought the compact command might work but still a no go.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: re-archiving a file without...
    « Reply #26 on: April 12, 2013, 05:48:39 PM »
    I cant wait till class tuesday to find out her magic answer
    Please update us on the Magic Answer  :)
    I was trying to dereference Null Pointers before it was cool.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: re-archiving a file without...
    « Reply #27 on: April 12, 2013, 07:25:41 PM »
    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...
    " Anyone who goes to a psychiatrist should have his head examined. "