This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 2701. |
Solve : copy & rename? |
|
Answer» Hi EVERYONE, |
|
| 2702. |
Solve : Creating a batch file? |
|
Answer» I would like to create a batch FILE that would LOG off the current user and shut down by itself once its completely logged off. I think it's possible but i don't know how. And no, simply shutting down the computer without logging off isn't what I'm looking for. Could someone present a command/s that will do this for me?Shutdown -l -t 01 |
|
| 2703. |
Solve : XCOPY command in bat file doesn't run as scheduled task? |
|
Answer» Hi, |
|
| 2704. |
Solve : Filenames in Subdirectories? |
|
Answer» I'm trying to figure out a simple way to get a list of file names from a parent folder and all of its subfolders. |
|
| 2705. |
Solve : Help with making a bat file for log filing? |
|
Answer» I'm looking to make a batch FILE that can create about 2000 very small logfiles (Just a simple netstat -N command) so I can do some IP address specific logging. Is there anyways to create a counting number, similar to c++ where the variable would just be similar to a++ would mean a would increase by 1 each time? For /l %%A in (1,1,2000) do (or use a for loop as dusty has given. Perfect - Thanks for the help fellas. Also thanks for the welcoming ^.^ |
|
| 2706. |
Solve : Copy and Overwrite? |
|
Answer» HI, all Just to be curiosity that’s BAT. File”, I have very newly it and interesting wanted some one help to LEARNT me more, I have thing if I create the Bat.file that’s can COPY and overwrite, let say, just clicking the bat file, copy c:/my document/personal.xls than overwrite to the D:/my document/personal.xls. Can it be do and how to present the statemnt. First off, your slashes are backwards. It may bring up and error while programming. You want to overwrite the file? Code: [Select]DEL FILE-YOU-WANT-TO-OVERWRITE.EXT COPY FILE-YOU-WANT-TO-REPLACE-IT-WITH.EXT D:\PATH-TO-FILE\FILE-YOU-WANT-TO-OVERWRITE.EXT Thanks the advise.. can u help me the code , Was the code I gave you on 2 lines or 3? I hate mobile browsers adding line breaks. I wish it would just format the page normally. Quote from: Helpmeh on October 12, 2009, 09:02:25 PM Was the code I gave you on 2 lines or 3? Dear Helpmeh Thanks very much and i 'll try my self as I newly for this one. Thank |
|
| 2707. |
Solve : Copying files with a .bat? |
|
Answer» Code: [Select]ECHO. |
|
| 2708. |
Solve : Printing to usb port from a program written in pascal? |
|
Answer» sorry to be a pain, but I have read forums and not FOUND answer, I have a similar problem. My work computers run Vista but my main ACCOUNTS program is a very old dos based program written in pascal. I need the speed of the modern computers to run the rest of my one person business, but I need the dos program for twenty years of records! I have to date , been able to install pci parallel cards to run the two printers used in the accounts program because I can't get the program to use usb printers. I can SEE a time when parallel cards will not be available (they are hard enough to find now), so how can I get the program to use usb PORTS, or is this not possible? |
|
| 2709. |
Solve : .bat to findstr and open file containing string? |
|
Answer» I am not so good at this at all but im sure trying... i want it to then open that file What if it finds the text in more than one file?I had thought about that, and it shouldn't happen in this case, these numbers are all specific to certain lots. (but you are right key word here is "shouldn't" however... if there is way way to display the file(s) found containing that string in some wort of explorer type window so you can click and open one... that would be even betterGood Luck |
|
| 2710. |
Solve : Reading file properties? |
|
Answer» he requested the attributes and dates... however your solution isn't quite there yet, since it still has the bulky surounding text output from dir and attrib. Ghost,nowhere in the rules says this forum is just for cmd commands. so suck it up. Quote I suggest Ghost use Unix( Linux ) commands "Chmod: or "ls -last" for the attributes of the file.chmod doesn't even come close to displaying file properties on linux. do you even understand what chmod does? Does OP want to change file permissions? I doubt so, since he doesn't SAY in his post. Which unix/linux platform are you on ? i don't recognise -last switch from ls. Also, the proper tools to use in *nix to list file properties are stat (or GNU find with printf ). Quote The Ghost VBS uses a separate line of code for each attribute.look carefully again at the code. for each file listed, it display all the attributes of that file. Quote Batch only needs attrib.bull.. show your batch code then... Quote By the way, Yogesh123 , the orginal poster, requested the properties of one file each time and not all the files in the directory or on the the C Drive.if he just want a script to PASS a file name to it each time, its trivial to change. No big deal. just remove the loops.... I'm looking... but I see no batch board. I see a "Microsoft DOS" board, which has been already discussed to apply to both pure DOS AND windows-based DOS prompts. This includes the windows scripting host, which was designed to replace, at least in some capacity, Batch files.as we say here, shut up and have some pie. Ok, actually I'm the only one that says it. but you cannot go wrong with pie.I don't like most kinds of pies i do like pumkin pie with alot of whipcream though there's alot of people who don't like pie if america had to agree on one food to eat the rest of there lives in a vote i wonder what it would be i don't think it would be pieQuote from: billrich BC_Programmer talks with great authority but has produced no Batch code or any other codehe has already said in his post he doesn't know a solution. And if he feels like it and wants to write that code, he will, and he certainly knows what he is talking about. The easiest solution is Ghostdog's VBScript where you can refer to each property by name and not some hieroglyphic token name. However (sigh) if you insist on a batch solution, this is one way: Code: [Select]@echo off set /p fname=Enter file name: dir /tc %fname% > dir.txt for /f "skip=5 tokens=1" %%v in (dir.txt) do ( echo DATE Created: %%v goto next ) :next dir /ta %fname% > dir.txt for /f "skip=5 tokens=1" %%v in (dir.txt) do ( echo Date Accessed: %%v goto next ) :next dir /tw %fname% > dir.txt for /f "skip=5 tokens=1" %%v in (dir.txt) do ( echo Date Written: %%v goto next ) :next dir %fname% > dir.txt for /f "skip=5 tokens=5" %%v in (dir.txt) do ( echo Fully Qualified Name: %%~fv echo Drive Specification: %%~dv echo Path Specification: %%~pv echo File Name: %%~nv echo File Extension: %%~xv echo Short Name: %%~sv echo File Attributes: %%~av echo File Date/Time: %%~tv echo File Size: %%~zv goto next ) :next del dir.txt Good Luck(Sigh) The file I coded does not use a command line parameter, but prompts for the fie name. I'm confused about the file name timeinseconds, when in fact the file reported by the batch file is C:\$WINDOWS.~BT. The file name and file extension are correct as reported in the output. The attributes are also correct (directory). I have no idea why size was not reported correctly,except directories do not have size properties (at least from the command prompt). SidewinderThis thread is better than many TV soaps. Good job Sidewinder. I'm SORRY I took up too much of your time. Keep posting; you know what you are talking about.Quote from: billrich on October 10, 2009, 12:15:00 PM I used the snake's code except a command line ARGUMENT instead of a prompt. A twinkle in his eye and murder in his trousers, my mother used to say, or "all piss and vinegar"... Quote from: billrich on October 10, 2009, 12:15:00 PM I used the snake's code except a command line argument instead of a prompt. Ironic. All you've done since your original post is purposely invent situations in which other peoples solutions break. For example by munging the batch file sidewinder provided. It works fine for me. Obviously you failed to "convert" it to use a command-line argument, because it works fine here. for a icon file I have: Quote It failed when I tried to use it on files from another drive: Probably easily fixed with a PushD of some form, since it works from that directory: Quote
In either case perhaps before making alterations to a batch file Billrich should test it as provided, rather then making changes and proclaiming epic failure even when it's fully possible the changes caused the problem, as I believe to be the case here. Seems to work fine. Of course I didn't mess about with the innards like a inept surgery intern. I believe the logic at this point speaks for itself for everybody but SpectateSwamp Billrich, who will continue on with analogies that bring back his fond memories of the ranch, and yet have no bearing to the context at all. In other news, I also converted (somewhat more successfully then the batch code... which I didn't mess with at all) the VBS file to access only a single file specified as an argument. Code: [Select]Set objFS=CreateObject("Scripting.FileSystemObject") strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") strFile= wscript.Arguments(0) Set objFile = objFS.GetFile(strFile) name=Replace(ObjFile.Path,"\","\\") s="Select * from CIM_Datafile Where name = """ & name & """" Set colFiles = objWMIService.ExecQuery(s) For Each objFile in colFiles Wscript.Echo "Access mask: " & objFile.AccessMask Wscript.Echo "Archive: " & objFile.Archive Wscript.Echo "Compressed: " & objFile.Compressed Wscript.Echo "Compression method: " & objFile.CompressionMethod Wscript.Echo "Creation date: " & objFile.CreationDate Wscript.Echo "Computer system name: " & objFile.CSName Wscript.Echo "Drive: " & objFile.Drive Wscript.Echo "8.3 file name: " & objFile.EightDotThreeFileName Wscript.Echo "Encrypted: " & objFile.Encrypted Wscript.Echo "Encryption method: " & objFile.EncryptionMethod Wscript.Echo "Extension: " & objFile.Extension Wscript.Echo "File name: " & objFile.FileName Wscript.Echo "File size: " & objFile.FileSize Wscript.Echo "File type: " & objFile.FileType Wscript.Echo "File system name: " & objFile.FSName Wscript.Echo "Hidden: " & objFile.Hidden Wscript.Echo "Last accessed: " & objFile.LastAccessed Wscript.Echo "Last modified: " & objFile.LastModified Wscript.Echo "Manufacturer: " & objFile.Manufacturer Wscript.Echo "Name: " & objFile.Name Wscript.Echo "Path: " & objFile.Path Wscript.Echo "Readable: " & objFile.Readable Wscript.Echo "System: " & objFile.System Wscript.Echo "Version: " & objFile.Version Wscript.Echo "Writeable: " & objFile.Writeable WScript.Echo "Install Date: " & objFile.InstallDate Wscript.Echo "-----------------------------------------------------------------" Next This can be accessed in a batch file: Code: [Select] cscript fileattribs.vbs D:\testads2.txt D:\>fileattribs D:\testads2.txt Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved. Access mask: Archive: True Compressed: False Compression method: Creation date: 20090803234730.934563-420 Computer system name: TERATRON Drive: d: 8.3 file name: d:\testads2.txt Encrypted: False Encryption method: Extension: txt File name: testads2 File size: 287 File type: Text Document File system name: NTFS Hidden: False Last accessed: 20090803234730.934563-420 Last modified: 20090303190457.875000-480 Manufacturer: Name: d:\testads2.txt Path: \ Readable: True System: False Version: Writeable: True Install Date: 20090803234730.934563-420 ----------------------------------------------------------------- |
|
| 2711. |
Solve : Any one know how to hide a file?? |
|
Answer» A friend told me I could creat files in dos system, while could not open in microsoft system. Any one know the exact steps? Well, first off, you are running XP. There us no DOS in XP. There is the COMMAND prompt however, and I shall continue. the correct syntax would beA lot of PEOPLE can view hidden files through folder options. Most people can't view system files (+s) because a message box pops up to ask if they're sure and system files are important BLABLABLA and they click no. System/hidden files show up FINE for me in explorer with no prompt of any form. It is only specific folders that show that prompt; I believe it is a desktop.ini setting for that folder.When you try to change the option of viewing the system files from the reccomended option, it does prompt you not to do it. |
|
| 2712. |
Solve : auyo run and logging? |
|
Answer» i am having troble with the autorun files they wont work on my memorystick so i plug it in nothing happens forever am having troble with the autorun files they wont work on my memorystick so i plug it in nothing happens forever USB cannot be autorun like a CD, however you can CREATE your own option in the "What do you want Windows to do" screen which the user can click to get things started. Check out this method Be sure to use relative path pointers as the USB drive letter will be DIFFERENT on each system. Quote and is there a way of recording what program sombody has been on and how long for How are they starting the program now? Double clicking an icon? Batch file? VBScript? You may have to wrap the executable in a batch file which in addition to loading the program, can log the start and end TIMES. Good luck. |
|
| 2713. |
Solve : Help for sleep command in batch script? |
|
Answer» Dear All, |
|
| 2714. |
Solve : Simple question.? |
|
Answer» Hello, |
|
| 2715. |
Solve : big prob? |
|
Answer» when i run a batch file the comand window opens up then closes strait away i need help to fix this problem please ☺open up a normal command prompt i.e. from start>run>cmd. then run your batch PROGRAM from there. if it's an error that's forcing an exit the original cmd will catch it. if it's an exit you've left in (i've don that before couldn't work out why it was exiting) then it won't catch it you'll have to look through the batch . |
|
| 2716. |
Solve : low poh...? |
|
Answer» low how i can browse the friendster if it is in BLOCK??quick question- have you perhaps read the forum rules that EXPLICITLY state we will not ASSIST with the circumvention of any form of security/banning/authentication? |
|
| 2717. |
Solve : Amiga Dos & MS Dos? |
|
Answer» I have a friend with a mid-1980's Amiga PC running Amiga Dos with the Amiga OS Workbench shell. He has LOTS of games for this computer on FLOPPY disks. |
|
| 2718. |
Solve : for %v in was unexpected at this time? |
|
Answer» Code: [Select]cls The DOS/Win98 version of FOR is quite a bit different from the NT family version found in Windows 2000 and later.is probably the REASON why. I guess I should perform a google seach maybe to see the differences and why for the change between pre-NT and NT FOR statement parameters, since that is what it appears to be now. Thanks for pointing that out!. |
|
| 2719. |
Solve : Batch filebackup to date stamped folder? |
|
Answer» I am doing a project where i have to create a menu system to backup files to a SPECIFIC location, backup files that have been created since last backup and offer a restore files option. The only problem i have is how to get the program to copy all files from a specific folder to a date stamped folder. Any help appreciatedplease show your local date format setting |
|
| 2720. |
Solve : Archive Files? |
|
Answer» I am trying to write a script that will do the following: |
|
| 2721. |
Solve : Win/Batch: How to get the folder name from path? |
|
Answer» Hi, Actually, my situation is a bit complicated. If you are going to ask the user for the folder name, then the computer need not find it. After the folder name is assigned to a variable, how will the variable be used? If you have the folder name, the computer can find the path to the folder: dir /s foldername from the root directory will find the path. Most users cannot enter a complete path correctly. And your goal is to assign a foldername to a variable. The user provides the folder name. I don't really understand your goal or problem. Actually I am going to perform backup for the content of folder from different users' request. User should input the full path of source folder (say "C:\app program\test folder") for backup. I am going to use XCOPY command to perform the backup task. Then, the newly created folder after backup will be appended by a TIME stamp (say ""C:\app program\test folder_2009-10-02"). Therefore I need to extract the folder name for manipulation. Here is my code: - ========================================================= echo Please input the name of folder that you want to backup and press "Enter" key set/p src= echo. REM create folder name(say "test folder_2009-10-02" and assigned to variable tgt) xcopy /a /c /d /e /k /h /y "%src%"\*.* "%tgt%"*.* echo. pause exit ========================================================= I think ASSIGNING the path string to a variable is feasible step that I can use FOR loop to extract the required field for manipulation. If so, I hope someone can tell me the WAY to extract the required string. BTW, any other suggestions are welcome. Quote from: lwkt on October 02, 2009, 07:13:25 AM I think assigning the path string to a variable is feasible step that I can use if %%F is path, %%~nF is lowest folder. Code: [Select]set mypath="C:\Program Files\X Ray Vision\Bin" for /f "delims==" %%F in (%mypath%) do set foldername=%%~nF echo %foldername% Code: [Select]BinThanks for Salmon's code. it solve my problem. But may I know the reason to use the option "delims==" in the FOR command? Quote from: lwkt on October 03, 2009, 08:55:19 PM Thanks for Salmon's code. it solve my problem. In case path has any spaces, set delims to be beginnning and end of line. Alternative is "delims=". Code: [Select]@echo off set mypath="C:\Program Files\X Ray Vision\Bin" echo with "delims==" for /f "delims==" %%F in (%mypath%) do ( echo Drive %%~dF echo Path %%~pF echo Folder %%~nF ) echo. echo without "delims==" for /f %%F in (%mypath%) do ( echo Drive %%~dF echo Path %%~pF echo Folder %%~nF ) Code: [Select]with "delims==" Drive C: Path \Program Files\X Ray Vision\ Folder Bin without "delims==" Drive C: Path \ Folder Program Got it !! thanks. |
|
| 2722. |
Solve : retrieving only filename using findstr? |
|
Answer» Hallo to everybody. I'm an italian user, so please forgive my poor english. I follow you from a lot of time but now I need your help so I've REGISTERED myself. |
|
| 2723. |
Solve : How do you change the background color and size of the cmd prompt window?? |
|
Answer» I have a batch file that opens a DOS cmd prompt WINDOW but I am stuck on how to change the background color and size of the new cmd prompt window. I have SOMETHING like this but it's only half work (if that make any sense). @echo off Was it tested, is it possibe something is missing Im use to using Command promt ... lol but i would do Color a for green on black otherwise you can type in color dfd to get help for DIFFERENT colors.. just trying to helpsorry that was wrong, dont know wat i was thinking, anyways, save this is as wtv.bat Code: [Select]@echo off color 0a mode con lines=50 cols=75 pause Also to view all possible colour combinations type in color help in cmd.Quote from: PirateSamir on January 27, 2009, 05:15:25 AM Code: [Select]mode con lines=50 cols=75 This line LOOKS familiar.... FBQuote from: fireballs on January 27, 2009, 05:17:52 AM Quote from: PirateSamir on January 27, 2009, 05:15:25 AMCode: [Select]mode con lines=50 cols=75 lol, its not my fault the guy didnt take your advice also is that my prob to that's a good question, which is weird considering the omission of punctuation.Wow. |
|
| 2724. |
Solve : Batch file to send email notification? |
|
Answer» I need to create a batch file that runs EVERY half hour or 1 hour on specific file (log file) and if it sees same TIMESTAMP more than 10 lines it should send email notification.Appreciate if ANYBODY help on this... |
|
| 2725. |
Solve : I need help in the Loop command? |
|
Answer» I'm trying to recreate a batch file i did about 3 years ago, I remember most of it, but I had it setup up where if the Call command to run a second batch file and the command to start a program into a loop. The kind of loop was that if the user of the computer closed the program that it WOULD reopen and start again. I cannot remember the right command. |
|
| 2726. |
Solve : How to invoke ssh from the batch file in windows? |
|
Answer» Hi All, |
|
| 2727. |
Solve : batch script move file based on name? |
|
Answer» Hello, |
|
| 2728. |
Solve : low guys...? |
|
Answer» i need your help for this problem.. i hope u all can help mePlease DONT try and GET more people to LOOK at your posts by posting again in a completely different area SAYING you need help. |
|
| 2729. |
Solve : I've been trying to get My batch file game to work but it isn't Please help? |
|
Answer» I want it to be knda an old fashioned multiple path game TRY THIS Why not use the /I in the IF statements? /I makes it case it so it ignores case and thus you could use Code: [Select]if /I %co% equ a goto N if /I %co% equ b goto E Which should still get you the same results as Code: [Select]if %co% equ A goto N if %co% equ B goto E if %co% equ a goto N if %co% equ b goto ESorry didnt think about that i was tired@echo off cls echo Today you will begin you Quest echo The quest to find echo The Ultimate Cupcake echo Not only is it the best tasting cupcake in the world but echo It will also grant you the power to echo Become invisible (for 3-11 seconds) echo. pause cls echo Do you want to Begin? set co= set /p co=Y or N: if %co% equ Y goto 2 if %co% equ N goto end if %co% equ y goto 2 if %co% equ n goto end :2 cls echo you wake up in a musty, dark, dank cave echo you dont know how you got there echo you feel as though someone is close to you echo watching you... echo. pause cls echo Do you A Run to the Exit or B Pull out your Dagger? set co= set /p co=A or B: if %co% equ A goto R if %co% equ B goto D if %co% equ a goto R if %co% equ b goto D cls echo You reach for your dagger echo but in place of where you dagger should be echo is some thing fleshy echo It is a hand it grips you by the nape echo Of your neck and hits you head against echo The cave wall. pause goto end :R cls echo You make a mad dash for the exit of the cave echo but as you head into the sunlight and out of echo the darkness, you look back for a second echo and notice something glimmer inside of the cave. echo. pause cls echo Do you A Go back inside or B Start trying to find your way home? set co= set /p co=A or B: if %co% equ A goto B if %co% equ B goto H if %co% equ a goto B if %co% equ b goto H :H cls echo You look at your surrounding horizon echo Hoping to see a sign of civilization echo You decide just to start walking echo. pause cls echo Do you A Head North or B Head East? set co= set /p co=A or B: if %co% equ A goto N if %co% equ B goto E if %co% equ a goto N if %co% equ b goto E :N cls echo You start walking North, echo After walking for about 5 hours echo It starts to get dark echo Then suddenly you fall into a deep pit echo. pause goto end :B cls echo You slowly walk back inside echo As you continue walking you see echo The glimmer again echo You slowly creep towards it echo As you get closer you hear echo Breathing. echo. pause echo Do you A Run out of the cave or B stand still? set co= set /p co=A or B: if %co% equ A goto R if %co% equ B goto S1 if %co% equ a goto R if %co% equ b goto S1 :S1 cls echo You continue walking for many hours until echo You think you can see your Hut on the horizon echo You start running echo As you enter the hut you realize it isn't yours echo And the inhabitants of the hut don't seem echo Friendly. echo. pause goto end :E cls echo You head East for about 4 hours echo You can see that it is starting to get dark echo. pause cls echo Do you A Setup camp or B Continue walking? set co= set /p co=A or B: if %co% equ A goto R if %co% equ B goto S1 if %co% equ a goto R if %co% equ b goto S1 echo :R cls echo You find a nice shaded spot in the trees echo You build a tepee type house echo Out of dead branches echo And spanish moss for insulation. echo You finish your temporary home echo Just in time it has become completely echo Dark you crawly into your tepee and go to echo Sleep. echo ... echo ... echo You wake up fealing refreshed echo. pause cls echo Do you A Look for food or B Continue walking? set co= set /p co=A or B: if %co% equ A goto F1 if %co% equ B goto B1 if %co% equ a goto F1 if %co% equ b goto B1 echo :B1 cls echo Do you A Go East or B Go West? set co= set /p co=A or B: if %co% equ A goto S1 if %co% equ B goto B3 if %co% equ a goto S1 if %co% equ b goto B3 echo :B3 cls echo You continue walking Westward echo You come across a Castle echo It has Large life-like stone echo GARGOYLES gaurding it echo. pause cls echo Do you A Go Inside or B Continue walking Westward? set co= set /p co=A or B: if %co% equ A goto Win if %co% equ B goto S1 if %co% equ a goto Win if %co% equ b goto S1 echo :Win cls echo You walk inside and see the echo Ultimate Cupcake on a pedistool echo You eat it! echo. pause goto Y :Y cls echo You Won!!! echo. pause exit :end cls echo You Lost echo. pause exit :F1 cls echo As you go looking for food echo You stumble upon a chest echo As you open it you see a cupcake echo "Could it bee the Ultimate Cupcake?" echo You pick it up and see a sign on it echo It says "Poison" surely a hoax echo To keep people from eating it echo You take a bite out of it. echo. pause goto endGRATZ final refined VERSION: color d @echo off REM"THE QUEST FOR THE ULTIMATE CUPCAKE" CREATED BY: EMMANUEL LYKES ALL RIGHTS RESERVED (NOT REALLY) cls echo Today you will begin your Quest echo The quest to find echo The Ultimate Cupcake echo Not only is it the best tasting cupcake in the world but echo It will also grant you the power to echo Become invisible (Side effects may include death, echo Explosion of bladder, loss of toes and/or fingers, echo And sudden cravings for Maple Syrup) echo. pause cls echo Do you want to Begin? set co= set /p co=Y or N: if %co% equ Y goto 2 if %co% equ N goto end if %co% equ y goto 2 if %co% equ n goto end :2 color d cls echo You wake up in a musty, dark, dank cave echo You dont know how you got there echo You feel as though someone is close to you echo Watching you "Maybe it's that creepy echo Girl at school who's been stalking me" echo You think to yourself. echo. pause cls color d echo Do you A Run to the Exit or B Pull out your Prison shank ? set co= set /p co=A or B: if %co% equ A goto R1 if %co% equ B goto D if %co% equ a goto R1 if %co% equ b goto D cls color d echo You reach for your shank echo But in place of where "Ol' shanky" should be echo Is something furry, echo It is the paw of the Crazy Giant Vampire Rabbit echo It grips you by the nape echo Of your neck and hits you head against echo The cave wall. echo You are the Rabbit's next meal echo. pause goto end :R1 cls color d echo You make a mad dash for the exit of the cave echo But as you head into the sunlight and out of echo The darkness, you look back for a second echo And notice something move inside of the cave. echo. pause cls color d echo Do you A Go back inside or B Start trying to find your way home? set co= set /p co=A or B: if %co% equ A goto B if %co% equ B goto H if %co% equ a goto B if %co% equ b goto H :H cls color d echo You look at your surrounding horizon echo Hoping to see a sign of civilization echo You decide just to start walking echo. pause cls color d echo Do you A Head North or B Head East? set co= set /p co=A or B: if %co% equ A goto N if %co% equ B goto E if %co% equ a goto N if %co% equ b goto E :N cls color d echo You start walking North, echo After walking for about 5 hours echo It starts to get dark echo Then suddenly you fall into a deep pit echo Filled with steak so Sweet and echo Savory you can't Help but eat them. echo After about 46 (and a half) steaks you echo Die of a heart-attack echo. pause goto end :B cls color d echo You slowly walk back inside echo As you continue walking you see echo Something move again echo You slowly creep TOWARD it echo As you get closer you hear echo Breathing. echo. pause cls color d echo Do you A Run out of the cave or B Stand still? set co= set /p co=A or B: if %co% equ A goto R1 if %co% equ B goto S2 if %co% equ a goto R1 if %co% equ b goto S2 :S1 cls color d echo You continue walking for many hours until echo You think you can see your Hut on the horizon echo You start running echo As you enter the hut you realize it isn't yours echo And the inhabitants (escaped Oompa Loompas) echo Of the hut don't seem friendly echo They violently shuv 23 pounds of fudge down you throat echo Then they roast you and feed you to thier pet gummi bear. echo. pause goto end :E cls color d echo You head East for about 4 hours echo You can see that it is starting to get dark echo. pause cls color d echo Do you A Setup camp or B Continue walking? set co= set /p co=A or B: if %co% equ A goto R if %co% equ B goto S1 if %co% equ a goto R if %co% equ b goto S1 echo :R cls color d echo You find a nice shaded spot in the trees echo You build a tepee type house echo Out of dead branches echo And old YMCA pamphlets for insulation. echo You finish your temporary home echo Just in time, it has become completely echo Dark you crawl into your tepee and go to echo Sleep. echo ... echo ...zzz echo ... echo You wake up feeling refreshed echo. pause cls color d echo Do you A Look for food or B Continue walking? set co= set /p co=A or B: if %co% equ A goto F1 if %co% equ B goto B1 if %co% equ a goto F1 if %co% equ b goto B1 echo :B1 cls color d echo Do you A Go East or B Go West? set co= set /p co=A or B: if %co% equ A goto S1 if %co% equ B goto B3 if %co% equ a goto S1 if %co% equ b goto B3 echo :B3 cls color d echo You start walking Westward echo You come across a castle shaped like echo A giant Pikachu echo. pause cls color d echo Do you A Go Inside or B Continue walking Westward? set co= set /p co=A or B: if %co% equ A goto Win if %co% equ B goto S1 if %co% equ a goto Win if %co% equ b goto S1 echo :Win cls color d echo You walk inside and see the echo Ultimate Cupcake on a pedistool echo You eat it! echo. pause goto Y :Y color a cls echo YOU WON!!! echo. pause exit :end color c cls echo You Lost echo. pause exit :F1 cls color d echo As you go looking for food echo You stumble upon a chest echo As you open it you see a cupcake echo "Could it be the Ultimate Cupcake?" echo You pick it up and see a sign on it echo It says "MADE OUT OF CRACK IF echo YOU SNORT IT YOU WILL O.D." surely a hoax echo To keep people from snorting it echo You happily snort it up! echo. pause goto end :S2 cls color d echo You stand still hoping that whatever was breathing echo Went away echo You hear a loud crack behind you echo "Oh no it's Brittany Spears armed with echo A baby" She hits you repeatedly on the head with echo The baby until you are dead. echo. pause goto end |
|
| 2730. |
Solve : password recovery? |
|
Answer» help ive forgotten my password to my website and i cant log on and the password recovery system is not working is there another way such as a PEICE of code or a website that can help please reply We don't give password recovery help on here. Sorry. the funny thing is i am the admin of the site Well then, shame on you. Quote from: steven32collins on December 02, 2008, 11:50:06 AM the funny thing is i am the admin of the site Interesting...we haven't heard this one before. And no...it's not funny.Quote from: patio on December 02, 2008, 01:52:02 PM Quote from: steven32collins on December 02, 2008, 11:50:06 AMthe funny thing is i am the admin of the site I'm telling you! It definitely IS my laptop! My 6 month old baby reset the BIOS password! The cat helped her! "Right after i spilled coffee on the keyboard..."ask the one who writes the codesThere are some BIOS password recovery programs. I'm a BIT leery about downloading unknown programs, as I had nasty experiences with a trojan stuck in my system restore...Quote from: qwah! on December 05, 2008, 04:58:58 PM There are some BIOS password recovery programs. I'm a bit leery about downloading unknown programs, as I had nasty experiences with a trojan stuck in my system restore... How is a BIOS password recovery program going to enable him to login to a website he can't remember the password for ? ?As far as BIOS passwords are concerned, they provide no security since you can just remove the battery. i have finaly reset my ACCOUNT what i had to do is get my freind to log onto the admin cp and find my account delete it then i had to make it again (i could not change the password from someone elses acount (it has password comfermation it asked for my old one) after i made a new one and had to make it root admin again so i got it working againI'm not convinced this would EVEN work...but good to hear. |
|
| 2731. |
Solve : Get only the date? |
|
Answer» BFC, what part of "we don't do peoples school assignments for them" don't you understand?Code: [Select]|date |find >> Date.txt Code: [Select]|date |find >> Date.txt Batchrocks, could you explain that code please? (Have you tested it?) Quote We try not to HELP with homework. If this is what you are after, please at least be honest and don't try to hide the purpose for the QUESTION. HONESTY sometimes gets results!Source 17 posts and no solution. Hmmm, I suggest a compromise. The script below uses Win98 BATCH language. It produces the correct RESULT in WinXP but not Win98. After dissecting the code to see how it runs, you should be able to produce the correct result in Win98. Code: [Select]@echo off ver | date > temp.bat echo set dt=%%5>the.bat call temp.bat del temp.bat del the.bat echo %dt% Hint: 3 changes to the code must be made to run correctly in Win98. Good luck. An excellent solution, Sidewinder! I got it to work on my old computer . |
|
| 2732. |
Solve : creating directory in DOS? |
|
Answer» hello, |
|
| 2733. |
Solve : directory name=date and hour?? |
|
Answer» Hi |
|
| 2734. |
Solve : Storing command results in a variable.? |
|
Answer» Lets SAY I TYPE in |
|
| 2735. |
Solve : using usb jump drive in a msdos-only os? |
|
Answer» Is there a way to set up msdos to recognize a USB jump drive to store files as on an a: drive? was hoping something else might have come along Well, yeah. Adter the Days of DOS lots of things came along so that upgrading DOS was not worth the effort. Now we have more HARDWARE and more FREE software than before. We have other kins of flash drives. You could get card READER that will work in a MS DOS machine. Not a USB device, but a flash card reader. And why do you HAVE to use DOS? There are free OS that can do the job. Does the system have a Hard Drive? Does it have a CD-Drive? Is this a old system with only a floppy and a couple of USB ports? I'm using it on a ~3Ghz dell to collect data via a qbasic pgm. The system was wiped clean of the xp os and just left with dos 7, which works fine for what I need. If I loaded a win os (98 and >) I could easily run my pgm in a dos shell and switch to win to xfer data to jump drive. Is there a freeware windows substitute out there? Or something that would accomplish the same thing? (linux?) Thanks!Puppy Linux is very small and boots fast. You put it on a CD, boot it, mount and read your USB and copy the files to the DOS drive. Then reboot back into DOS. Get a ISO CD image of Puppy at: http://www.puppylinux.org/ Anything here of use: http://www.theinquirer.net/inquirer/news/069/1046069/yes-there-are-usb-drivers-for-dosQuote from: Geek-9pm on January 31, 2009, 09:34:35 AM Puppy Linux is very small and boots fast. You put it on a CD, boot it, mount and read your USB and copy the files to the DOS drive. Then reboot back into DOS.I have got a bootable MS-DOS 7 pen drive which has QBasic. It is FAT formatted and it is a breeze to copy files onto it and boot the PC from it. Quote from: Dias de verano on January 31, 2009, 02:19:12 PM I have got a bootable MS-DOS 7 pen drive which has QBasic. It is FAT formatted and it is a breeze to copy files onto it and boot the PC from it.Quote from: wkmacc on January 31, 2009, 02:39:32 PM Outstanding! Er, is a pen drive a jump drive? "JumpDrive" is what Lexar call their USB flash drives. It is a brand. Names in common use for these drives are "memory stick", "key drive", "USB key, "pen drive", etc. They look like this Quote Where did you find it? I just bought a 128 MB flash drive (about 5 years ago), and using instructions very widely available on the Web, I made it bootable. This is as good a place as any to start. http://www.bootdisk.com/pendrive.htm The method I used involved using the HP utility mentioned on that page. Quote will it load as freestanding os on my HD ? don't have a cd rom You have to borrow a CD Drive from sombody. Or have then write it to a HHD for you Here is the tutorial. http://www.puppylinux.org/wiki/installation/hdd-full-installation |
|
| 2736. |
Solve : Suppress the black DOS screen when running a batch file? |
|
Answer» My clients are running Window XP. |
|
| 2737. |
Solve : MS SQL data to text file?? |
|
Answer» is it possible to convert a mssql data to a text file using a batch file?Are you referring to MS Access or MS SQL Server? Access has a built in export facility on the file menu. With SQL Server you will need to write your own program or perhaps a script that can connect to the database. Do you know how to write the script to connect to MS SQL server? In order to keep down the embarrassment level, I have LEARNED not to post when there are too many variables to come to a clear solution. On the other HAND, some seemingly simple QUESTIONS have morphed into complex entities that required actual <gasp> research. Let hope this won't come to that. The easiest way to connect to SQL Server is using ActiveX Data Objects (ADO). Which VERSION of SQL Server are you using and what is the server name? The key to accessing a database is the connection string. The more information about your database you can provide, the easier it will be to write a script. An earlier response provided a link. Any reason it was not helpful? |
|
| 2738. |
Solve : Looking for all %% calls listing? |
|
Answer» I was wondering is anyone knew of a site that shows all % % system calls. GOOGLE search for batches %% calls shows tons of Phone Call info but no system call info. If Command Extensions are enabled, then there are several dynamic More info here.... This site claims to have a full listing of system information variables. Hope this helps. There's something wrong with their definion of %random%. It doesn't expand to a decimal, it expands to an integers. Point taken. Here's a Wiki... Quote from: Helpmeh on October 01, 2009, 04:30:40 PM There's something wrong with their definion of %random%. It doesn't expand to a decimal, it expands to an integers. "Decimal" means base-10.Quote from: BC_Programmer on October 01, 2009, 06:56:46 PM "Decimal" means base-10.Ok. I thought decimal is the little . after the one's digit. And %random% does expand to an integer. How many times does it take before an un-modified %random% expands to a number with a decimal (that is not 0 you sneaky goose). It always does. the number is base-10. it would be completely useless if the %RANDOM% variable EVER game back a floating point number since you can't process them with set /a. Decimal; "dec" means 10. hexadecimal: hex (6)+ dec(10) = 16 (0...9, A...F). One can even "invent" bases using the standard prefixes. base 18? Probably Octadecimal. base 8? Octal. an Integer cannot have a fractional portion but a floating-point number can be an integer.Hey Cool, Thanks for info...so they are reserved variable names then I am guessing? That would be why google had no hits for me...wrong statement..lol Many thanks to all who CONTRIBUTED info on this. Dave |
|
| 2739. |
Solve : Basic Batch File? |
|
Answer» I have no clue about MS DOS commands or Creating Batch FILES. I have no clue about MS DOS commands or Creating Batch Files.if you have no clue, start to do some reading by yourself. see wiki and the part where it says external links. |
|
| 2740. |
Solve : doskey macros? |
|
Answer» Could someone give me an EXAMPLE of how to use $* in a command line... doskey d=dir /o-nwill list the directory in reverse alpha order but you cannot add any further parameters at execution TIME. If, at the command prompt, you enter Quote d /bthe /b parameter will be ignored and a FULL listing in reverse alpha order will be produced. However, Quote doskey d=dir /o-n $*will allow further parameters to be added so that Quote d /bwill PRODUCE a listing in reverse order in bare format. Heaps more info here... thank you sir You're welcome.. |
|
| 2741. |
Solve : Finding the Identities GUID? |
|
Answer» Hi i'm trying to make a batch file to find the unique GUID of an account in windows xp. |
|
| 2742. |
Solve : Need Help with LAME batch processing? |
|
Answer» I just needed HELP with batch processing of lame (it works in DOS) |
|
| 2743. |
Solve : disk read error.....press ctrl+alt+del to restart? |
|
Answer» hi, |
|
| 2744. |
Solve : Is it possible to my batch file always on top?? |
|
Answer» I've created a simple batch FILE and would like my batch file to be always on top of all other WINDOWS. Is this possible? |
|
| 2745. |
Solve : Antivirus is Soluation of Virus ???? |
|
Answer» HI, all are useing antivirus SOFTWARE but STILL virus is load and we format the SYSTEM so what is the roll of antivirus. with antivirus our system's 40% to 50% RAM useing on that process our computer going slow down. so i ask you to all antivirus is soluation or just a ? |
|
| 2746. |
Solve : Reply problem? |
|
Answer» I want to add a reply to this topic but the Reply, Notify, Send Topic and Print buttons are hidden when the page completes loading. The buttons are displayed on other topics. Any ideas what I'm doing WRONG PLEASE? 17:37:33.00 Then change your date format in CP>Regional & Language Options>Customise>Time That's XP.... Still doesn't solve my problem of not being able to Reply to one Topic out of the many.Quote from: BC_Programmer on January 28, 2009, 04:20:49 PM LOL @ calling it "navy time" makes a change from "military time"... these Yanks... ... Where I am it's called "normal time".... Dias - I wanted to thank you in-topic for your response to my query here but for some obscure reason or reasons I cannot do so and I note you do not appreciate PMs about FORUM topics. So, out of topic, a big thank you for your excellent scripts. H..Hedonist - glad I was able to help - I have sent you a PM. |
|
| 2747. |
Solve : change alpha by one value? |
|
Answer» I have a script that TAKES the date and CREATES a directory named yyyymmdd daily. |
|
| 2748. |
Solve : How do you use concatenate in batch file?? |
|
Answer» The user enters in the command line: ADOBE, macromedia, whatever |
|
| 2749. |
Solve : how i can kill proposes services? |
|
Answer» I am using Xp Pro sp3 It raises the red banner. The flag requires a bit more strength to hoist up.and a strong wind. There's always plenty of that here.... Quote from: patio on September 26, 2009, 10:22:59 AM There's always plenty of that here.... I went to a Lebanese restaurant last night and had koftes... I am so sorry for the wrong language i typed wrong Of right how i can kill processes services & i fhnd from friend Code: [Select] well what do you mean if you mean the service in the task manger beside the process then i think i have a small tool that can do that http://www.dynawell....2000/netsvc.zip when you want to do something you will need to use this commands """netsvc \\%computername% /LIST << this will list the Service""" """netsvc \\%computername% /stop "Service name" << this will Stop the Service"""" to start replace stop with start Edit: found another way using internal tool """sc stop "Service name" << that will stop the service""" and to start type start thx for help to all |
|
| 2750. |
Solve : A log, that makes a folder.? |
|
Answer» Hello! You would just add this This only does make a file, T.bat, then doesn't make a folder, and, it doesn't call it. EDIT: Now, it makes the T.bat and then it makes a folder, folder, and then it moves T.bat inside the folder. Code: [Select]@echo off echo mkdir folder >> T.bat call T.bat move T.bat folderOh, I assumed you knew to put the name of the file where I put file. |
|