| | |
Windows script need help
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Nov 2006
Posts: 10
Reputation:
Solved Threads: 0
Anyone wanna take a crack at this?
Display “File Maintenance Script” in the title bar
Clear the screen
Display a menu of options for delete, rename or exit
Using called procedures, either delete all files in H:\scripts, rename all files so that they have the extension .bak, or simply exit the program
Display “File Maintenance Script” in the title bar
Clear the screen
Display a menu of options for delete, rename or exit
Using called procedures, either delete all files in H:\scripts, rename all files so that they have the extension .bak, or simply exit the program
I'm sorry, but Do Your Own Homework. Or at least make an attempt at it.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
•
•
I am sorry fry but that wasn't the answer I was looking for ;-)
Thanks
"Technological progress is like an axe in the hands of a pathological criminal."
•
•
Join Date: Nov 2006
Posts: 10
Reputation:
Solved Threads: 0
•
•
•
•
Too bad. It's pretty obvious that this is your homework, and asking for help without showing any effort is not encouraged here. Post the code you've got so far, and we might be able to help you with it.
Thanks
•
•
•
•
No sweat. And glad it was obvious. It was supposed to be. <bfg> ... I think it is presumptious of you to "assume" I have put in no effort. Remember what happens when you assume? "You make a donkey out of yourself" :cheesy:
•
•
•
•
Using called procedures, either delete all files in H:\scripts, rename all files so that they have the extension .bak, or simply exit the program
•
•
•
•
I am not doing any complex DB extraction or anything.
Not to be harsh or anything, and I'm happy to help you with a part that you're stuck on. But me (and everyone else) don't want you to get marked on something you didn't write.
Thanks.
"Technological progress is like an axe in the hands of a pathological criminal."
•
•
Join Date: Nov 2006
Posts: 10
Reputation:
Solved Threads: 0
•
•
•
•
OK, look buddy. We're simply not going to do your homework, and insulting us isn't going to make it go any better. If you have been making an effort, you should at least be able to figure out a few of the steps. Tell us which part of the assignment you need help on, or don't understand. For example:
You should have at least tried to do it. Post some of your attempts; it shows us that you actually want to get it done, and not simply let us do your homework.
Also the fact that you were "disguising" the fact that it was homework is annoying; when you say "Anyone want to take a crack at this," you're making it sound as if it's supposed to be a brainteaser for us to solve. But it's pretty easy to tell that it's your homework, so why not say so?
Not to be harsh or anything, and I'm happy to help you with a part that you're stuck on. But me (and everyone else) don't want you to get marked on something you didn't write.
Thanks.
•
•
Join Date: Nov 2006
Posts: 10
Reputation:
Solved Threads: 0
Sorry I apologise I thought I would have had more time to respond, but with the holiday and all, anyway I am sorry. I did not mean to insult you. If I did I humbly take it back. I just have a joking-around sense of humor and I guess you'd have to know me to know that. So once again I apologize :-( to :-) I appreciate you comments on the code I am posting below. I am on the road and do not have access to a compilier so forgive any obvious errors. I am sure there is a simplier way but this is my first crack into scripting so here goes...
ps you might even cringe when you see this!
ps you might even cringe when you see this!
@ECHO off
REM *****************************************************************
REM
REM Script Name: File_Maintenance_Script.bat
REM Author: ME
REM
REM Description: ****************************************************
REM I. Display “File Maintenance Script” in the title bar II. Clear the screen III. Display a menu of options for delete, rename or exit
Using called procedures, either delete all files in H:\scripts, rename all files so that they have the extension .bak, or simply exit the program
REM *****************************************************************
REM Script Initialization Section
IF NOT "%OS%" == "Windows_NT" ECHO Unsupported Operating Systems & GOTO :EOF
REM Main Processing Section
REM ****Create the scripts directory****
MKDIR scripts
REM****Sets command line to scripts directory****
cd/scripts
title File Maintenance Script
REM Clear the display
cls
echo (1) delete (2) rename (3) exit
REM *wait to accept input from a keyboard*
:NUMBER
IF %1 GTR %3% (
CLS
ECHO.
ECHO.
ECHO Too high, try again
ECHO.
ECHO.
PAUSE
)
IF %1 LSS %1% (
CLS
ECHO.
ECHO.
ECHO Too low, try again
ECHO.
ECHO.
PAUSE
)
IF %1 EQU %1% (
CLS
ECHO.
ECHO.
ECHO You have decided to DELETE this directory's contents
ECHO.
ECHO.
PAUSE
CALL :DELETE
)
)
IF %1 EQU %2% (
CLS
ECHO.
ECHO.
ECHO You have decided to RENAME this directory's file extensions all to *.bat
ECHO.
ECHO.
CALL :RENAME
PAUSE
)
)
IF %1 EQU %3% (
CLS
ECHO.
ECHO.
ECHO You have decided to EXIT
ECHO.
ECHO.
CALL :EXIT
PAUSE
)
:DELETE
del *.*
GOTO :EXIT
:RENAME
REN *.* *.bat
GOTO :EXIT
:EXIT
exit Last edited by WaltP; Nov 29th, 2006 at 5:11 am. Reason: Added code tags
•
•
•
•
I am on the road and do not have access to a compilier so forgive any obvious errors.
- Although this is shell scripting, it's certainly Windows, and not Linux. And since I'm running Linux/BSD, I can't test any modifications I make on the code, even if I could understand Windows shell scripting.
- You don't need a compiler to run this code. COMMAND.EXE simply "interprets" the code, so there's no compilation necessary.
•
•
•
•
ABOVE: it seems an emoticon jumped in there that is supposed to be CALL : DELETE (w/o the space)
CALL:DELETE
"Technological progress is like an axe in the hands of a pathological criminal."
![]() |
Similar Threads
- windows script host - help me pls (HTML and CSS)
- Script error when booting up home xp (Windows NT / 2000 / XP)
- Windows scripting engine hosed? (Windows NT / 2000 / XP)
- Problems with Windows Script Encoder & #include directive (ASP)
Other Threads in the Computer Science Forum
- Previous Thread: Time complexity
- Next Thread: need hlep with finding a topic for my final year project
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery bigbrother binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computer computers computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dissertation dissertations dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea ideas internet iphone ipod itcontracts jobs kindle laser laws linkbait lsmeans mainframes marketing mobileapplication msaccess nano netbeans networking news os p2p piracy piratebay principles programming rasterizer research sam-being-cute sas science security sex simulation software spying stephenfry supercomputer supercomputing sweden technology turing turingtest two'scompliment uk virus ww2







ELETE