Taperssection.com

Gear / Technical Help => Post-Processing, Computer / Streaming / Internet Devices & Related Activity => Topic started by: blu666z on January 21, 2004, 02:08:11 AM

Title: Need a couple DOS commands
Post by: blu666z on January 21, 2004, 02:08:11 AM
Working on a batch file to run through the process I manually do everytime I convert a tape.  Need help with a couple commands.  
1.  After I fix sector boundries I need a command to delete the original file that was fixed and remove the 'fixed' from the new version.

2. Is there a way to retrieve the folder you are in and use that as a variable?  ie.  I want to name the MD5 file the same name as the folder it resides in.

-Kevin
Title: Re:Need a couple DOS commands
Post by: jpschust on January 21, 2004, 10:08:49 AM
ok the dos command to delete anything is:

del thisismyshinfixed.* (del is the command, the stars go in place of anythign you dont feel like typing out)

i think the rename command is ren, but thats from a long time ago
Title: Re:Need a couple DOS commands
Post by: Nick in Edinboro on January 21, 2004, 11:23:31 AM
Quote
Is there a way to retrieve the folder you are in and use that as a variable?

call your bat file with an additional parameter which is your folder
ex.
C:\> docleanup.bat foldername

ex2.
C:> docleanup.bat dtb2003_03_23

Use of variable in code
docleanup.bat

echo The folder you are using is %1
ren *.md5 %1.md5

Title: Re:Need a couple DOS commands
Post by: Nick in Edinboro on January 21, 2004, 11:24:28 AM
DOS Scripting is fun for me.. I have a whole lot more examples and stuff at home, including one where I traverse folders but I don't have it here at work.  Kevin, if your interested leave a note here and I'll dig them up at some point tonight.

Take care,
Nick
Title: Re:Need a couple DOS commands
Post by: Nick in Edinboro on January 21, 2004, 11:33:27 AM
Actually in thinking about it, you wouldn't need to feed the script the directory your in.

You could just tell the .bat file to do a CD command which will give you your directory, put it into a variable, parse it, and there you go.

I have some programs at home where I do something similar but instead I ping computers to see if they're alive or dead by grabbing a string from the results of the ping command.
Title: Re:Need a couple DOS commands
Post by: Nick in Edinboro on January 21, 2004, 11:48:24 AM
These should help put you on the right path, was starting to write something out for you but realized I gotta go in like 5 minutes.

Stuff on deleting files (http://www.chebucto.ns.ca/~ak621/DOS/Bat-Samp.html#DELE)

Shows how to strip a file of it's extension, might come in handy plus all sorts of other stuff, however not organized very well (http://gearbox.maem.umr.edu/~batch/exmp1.htm)
Title: Re:Need a couple DOS commands
Post by: blu666z on January 21, 2004, 07:27:55 PM
ok the dos command to delete anything is:

del thisismyshinfixed.* (del is the command, the stars go in place of anythign you dont feel like typing out)

i think the rename command is ren, but thats from a long time ago


I know what the command is just trying to automate the process.  ie. In my folder I have:
mel2004-01-17d1t07.wav
mel2004-01-17d1t07-fixed.wav

Looking for a way to delete original wavs where they have been fixed and then remove the '-fixed' extension.

-Kevin
Title: Re:Need a couple DOS commands
Post by: blu666z on January 21, 2004, 07:29:32 PM
Probably get stoned tonite and work on this.  That always seem to help me program for some reason.  To bad the real boss can't understand that!

-Kevin
Title: Re:Need a couple DOS commands
Post by: Nick in Edinboro on January 29, 2004, 04:37:44 PM
Probably get stoned tonite and work on this.  That always seem to help me program for some reason.  To bad the real boss can't understand that!

Kevin how did this turn out for you?  Get anything (besides the munchies)? ;)

I too, enjoy a little  :smoking: to help the creative/logic juices flow when I get the opportunity to work from home (contract jobs or hw, etc.).  

"Work work" is another story, do believe I'd just fall asleep in my cube :lol:
Title: Re:Need a couple DOS commands
Post by: Cooker on January 30, 2004, 11:58:10 AM
kevin, i have been wanting a batch file to strip the -fixed off of my files for some time. if only shntool had a suffix parameter...

also, i don't know if you knew this, but shntool can do the fixing and converting all in one step. no real need for you to have "XXXX-fixed.wav" on your pc at all - you can just tell it -o flac or  -o shn

you still have to get rid of that nasty -fixed suffix, but it makes deleting the original files that much easire (del *.shn)