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.
| 4001. |
Solve : Using format command to make bootable floppy.? |
|
Answer» I am trying to FIGURE out how tocreate a bootable disk using the format command in the command line. |
|
| 4002. |
Solve : Using if command with find? |
|
Answer» Finding whether a particular string is PRESENT in a text file can be done with the help of FIND COMMAND. How can we use the RESULT whether a string is found or not in an IF command and perform some commands for each case i.e when the string is found and when it is not found . Are there any VARIABLES that can be SET using the find command for its SUCCESS or failure results ?Immediately after thefind, test errorlevel, a value of 0 means found, 1 is not found Graham |
|
| 4003. |
Solve : Hot to plus two numbers in DOS?? |
|
Answer» There is needed for an auto-incrementing version number in my software build process. |
|
| 4004. |
Solve : Batch file logging question? |
|
Answer» I am using the following to del an old log file that a batch file creates: |
|
| 4005. |
Solve : Netpath? |
|
Answer» I was wondering how to netpath. I need it to remote shutdown my sisters comp, and it says I need a network path. I was curious if there is a way to make one. Any help is accepted.You... want to remotely SHUT down her comp? Just out of sheer morbid curiosity - why would you want to do this?A network path takes on the format of: |
|
| 4006. |
Solve : net logoff?? |
|
Answer» I KNOW that net logoff BREAKS the connection between network connected computers but would the connection between shared drives or folders be broken??The connection will be broken to the remote MACHINE unless they are persistent (a BOOT has the same effect). Shares remain in effect (even thru a boot) until they are specifically deleted. |
|
| 4007. |
Solve : dos window to close after starting the program? |
|
Answer» hello. I have a program that does not PLAY nice with our main SQL based application CALLED automate. I have a need to stop the service and restart the service and the additional exe that allows the program to run. I have so far |
|
| 4008. |
Solve : Batch help...? |
|
Answer» Hi guys, |
|
| 4009. |
Solve : What did I do wrong?? |
|
Answer» I have a bunch of joke programs on my computer (NAV doesn't like it, the old codger) and some are customizable with the command prompt. I'm writing a batch file to execute these programs with these special functions. create You may have missed a few, also create needs a colon in front. I presume that bombtemp and bombtemp2 are meant to be two different files. Code: [Select]:create REM - creates the batch file and writes it ECHO @echo off > bombtemp.bat ECHO cd \Documents and Settings\Timothy\Start Menu\Programs\Startup\ >> bombtemp.bat ECHO @echo off > bombtemp2.bat ECHO cd \Documents and Settings\Timothy\Desktop\Desktop Games\ >> bombtemp2.bat ECHO bomb.exe '%choice%' >> bombtemp2.bat ECHO cd \utilities >> bombtemp2.bat call bombtemp.bat del bombtemp.bat 8-)OK, I revised that code. My intention is as follows: Write a "bombtemp.bat" batch file, which includes instructions to create another batch file in the startup folder, which will execute the code. Ideally, I should have the following in the end: In C:\Utilities\bombtemp.bat: Code: [Select]cd \Documents and Settings\Timothy\Start Menu\Programs\Startup\ @echo off > bombtemp2.bat cd \Documents and Settings\Timothy\Desktop\Desktop Games\ >> bombtemp2.bat bomb.exe '%choice%' >> bombtemp2.bat cd \utilities >> bombtemp2.bat In C:\Documents and Settings\Timothy\Start Menu\Programs\Startup\bombtemp2.bat: Code: [Select]@echo off cd \Documents and Settings\Timothy\Desktop\Desktop Games\ bomb.exe '%choice%' cd \utilities And that's it. I used this batch file to achieve this: Code: [Select]@ECHO OFF cls ECHO This batch file will simulate a bombed program. It will place it in the startup ECHO folder so it will run at next startup. :begin set choice= set /p choice=Choose program to bomb: IF EXIST %choice% GOTO create ECHO Sorry, the specified program does not exist. GOTO begin :create REM - creates the batch file and writes it ECHO @echo off > bombtemp.bat ECHO cd \Documents and Settings\Timothy\Start Menu\Programs\Startup\ >> bombtemp.bat ECHO @echo off > bombtemp2.bat >> bombtemp.bat ECHO cd \Documents and Settings\Timothy\Desktop\Desktop Games\ >> bombtemp2.bat >> bombtemp.bat ECHO bomb.exe '%choice%' >> bombtemp2.bat >> bombtemp.bat ECHO cd \utilities >> bombtemp2.bat >> bombtemp.bat call bombtemp.bat What I got was "bombtemp.bat" in the startup folder with this code: Code: [Select]@echo off cd \Documents and Settings\Timothy\Start Menu\Programs\Startup\ @echo off cd \Documents and Settings\Timothy\Desktop\Desktop Games\ bomb.exe '"C:\Program Files\Opera\Opera.exe"' cd \utilities What the heck did I do wrong?Somewhere along the way this seems to have changed. In any case you need to escape certain characters to pass them thru a redirection: ^> should pass a single > to the output file ^>^> should pass a double >> to the output file You just gotta love the brains that came up with this stuff. |
|
| 4010. |
Solve : command?? |
|
Answer» Hey, |
|
| 4011. |
Solve : finding files to erase? |
|
Answer» Hi |
|
| 4012. |
Solve : Making backup? |
|
Answer» Hi, I made a batch file that makes a backup folder: First of all, what files do you think are nessesary(scuse my spelling) to make a backup of?This really depends on you, probably your my doctuments folder, with your doctuments, music, videos and pictures in it. Quote And I was wondering if it is possible to set this batch file to complete these tasks once a day, without having to open it?? just go to Scheduled Tasks in control panel and add the select the file and set it to run once a dayI see one problem: You're going to delete these backups once a day with that code. I'd be careful about that.You may want to CHANGE the / to \ as well.thanks everyone. I'm first I,m manually going to create back up and then it will be deleted everyday and replaced!Just curious: Why do you want these backups deleted every day?because I don't want like FIFTY backup folders!!You wouldn't GET fifty folders. You'd get all the backups in C:\backup\*.* (assuming the folder already EXISTS) |
|
| 4013. |
Solve : shutdown??? |
|
Answer» would this work or would you have to put "-m \\4ag4d7888" after "-f -s". |
|
| 4014. |
Solve : Batch file question 2? |
|
Answer» Hey, |
|
| 4015. |
Solve : batch help needed, appearance, net name......? |
|
Answer» HI im looking for some help for batch commands i was WONDER how i can change the appearance of the cmd window, eg if i can remove the title and scroll bar and how to sent the window and font size im using the command net name NAMEHERE /add, i was wondering if you could make it a hidden name that doesnt appear on lists of users on the network? and finally how to add a question at the end eg. "if you want to continue hit enter or press esc to exit" thanks Quote i was wondering if you could make it a hidden name that doesnt appear on lists of users on the network?Why would you want to do that?just so it doesnt clog up the network and people can see what PCS are on the network instead of lods of "screen NAMES" coming up ASWELL |
|
| 4016. |
Solve : Need help.. FTP Uploader? |
|
Answer» I am trying to make a .BAT FILE that uploads a file when he is draged to the .bat file.. |
|
| 4017. |
Solve : Del files by date? |
|
Answer» I need a batch file that can delete files by date and or time, using current date/time as a gauge..any help would be appreciated....this will be used in a windows 2000 environmentDelete files from where? A single directory? A tree structure? using current date/time as a gaugeUsed how? Are you aging files? More questions than answers. XCOPY has a date parameter. You could be super clever and extract the current date (mm-dd-yyyy) from %date% (%date% has that pesky day of week embedded), copy the files you want to keep to a temp directory, delete all the files in the current directory, then copy all the files from the temp directory back to the original directory. On the other HAND, you could write a script. The following will age files in a tree structure, deleteting all over 30 days old: Code: [Select]Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder("c:\temp") '<== change as needed Set colSubFolders = f.SubFolders For Each objFolder in colSubFolders ShowFiles objFolder Next Sub ShowFiles(Fld) Set k = fso.GetFolder(Fld) Set s = k.SubFolders Set kf = k.Files For Each objFile In kf If objFile.DateCreated < date - 30 Then Wscript.Echo objFile & " " & objFile.DateCreated '<== change End If Next For Each SubFolder In s ShowFiles SubFolder Next End Sub Save the script with a vbs extrnsion and run from the command line as cscript scriptname.vbs As written, the script will list the files to be deleted. If you agree with the results change the entire WScript.Echo line to fso.DeleteFile objFile, True. You could also change 30 to any number. Windows has many tools that are far better than batch language. This might just be one of them. Hope this gives you some ideas. 8-) would this script also work in windows 2003, i TRIED it and all i get is the windows script VER. and copy write info. is there something i'm doing wrong?Without knowing what directory you pointed the script to check, it would be difficult to guess what went wrong (if anything). One possibilty would be that none of the files in the directory are over 30 days old. Yes, the script will work on all Window versions starting with Win95C. Note: If you left in the WScript.Echo statement, the script should have listed all files over 30 days old. If you replaced that line with the fso.DeleteFile statement, there would be no output except the copyright info. Posting the script that you actually ran, and a DIR listing of the directory the script points to might be helpful. Let us know. 8-)The following command would delete TheFile only when it's time stamp is equal or older than a given RemoveDate. set TheFile=myfile.txt set RemoveDate=03/01/2006 xcopy "%TheFile%" .. /L /D:%RemoveDate%|find "0 File(s)">NUL&&del /q "%TheFile%" Running xcopy with option /L will only pretend to copy. Running xcopy with option /D:<Date> will only copy files newer than a given date. The find command would only succeed when 0 files would be copied, which means when the file is not newer than the given date. The && ensures that the del command only executes when the find command succeeded, so to say when the file is not newer that the given date. Hope this information is useful |
|
| 4018. |
Solve : deleting files? |
|
Answer» HI EVERYONE hope everyone is OK. |
|
| 4019. |
Solve : Quick Batch question? |
|
Answer» I'm sure this has been asked a thousand times, but I've looked on Google and the forums: How do I set the current directory as a variable?set = I believe you've mentioned that you run XP. %cd% will work equally well. |
|
| 4020. |
Solve : Error when I open DOS? |
|
Answer» When I open DOS, it says: 1. Click Start, click Run, type c:\windows\repair, and then click OK. http://support.microsoft.com/default.aspx?scid=kb;en-us;324767Quote Quote1. Click Start, click Run, type c:\windows\repair, and then click OK. Ok, I fixed that. Now, in DOS it says: Code: [Select]Cannot execute C:\WINDOWS\SYSTEM32\CMD.COM Memory allocation error Cannot load COMMAND, system halted Can i REMOVE this?If they don't already exist, add these lines to the config.nt file: dos=high, umb device=%SystemRoot%\system32\himem.sys files=40And just to be clear that is NOT DOS. It is command PROMPT. cmd.com cmd.[highlight]exe[/highlight] |
|
| 4021. |
Solve : MSDOS, executing param. in a Bat file? |
|
Answer» Hello, for compress with UPX a file, for EXAMPLE I open a msdos window and type upx.exe -o calc.exe , where calc.exe is the file to compress, I want MAKE a bat file that when I open it, it do AUTOMATIC, how I do? :s help please If you want to HARDCODE this: |
|
| 4022. |
Solve : Sending files using Ms-Dos? |
|
Answer» Does anyone know how to do that(send files to other COMPUTERS using msdos?)?How are the computers connected?Well, the only way I know is to use the net command. The procedure would include connecting to a remote COMPUTER's shared folder/drive/device then use the copy command to copy the file/files to the specified drive letter. And I am using real dos on all machines! :exclamationAre you sure? I find it highly unlikely that your school keeps old DOS machines around these days. I find it more likely that you are confused into thinking that cmd.exe or command.com is DOS. These are just emulators for the DOS enviroment; not the real thing. I agree. Until he overcomes this knowledge deficit all bets are off. Oh sorry, It's probably not DOS! :-/ I think its cmd.exe.Quote Oh sorry, It's probably not DOS! :-/Well, then then my first reply should probably work FINE. You cannot send files with "net send" although another command in the net family "net use" would probably be the way to go.thanks, it works!Could you give me an example, cos I'm not sure i'm doing it right? :-? :-/First, you would find the remote computer's hostname or IP address. There are several ways to do this.
IMPORTANT: You cannot connnect to any shared resource on any target computer if it isn't shared.thanks!! |
|
| 4023. |
Solve : Don't quite understand this?? |
|
Answer» Code: [Select]goto label%errorlevel% The part where it says "goto label%errorlevel%" Does it mean that it would jump to the ":label" that has the correct errorlevel beside it? And then do whatever tasks that are underneath it? And also, The % on either side of the errorlevel, would that mean that it changes? Yes it does change. Most MS commands issue errorlevels that can be checked in a batch file. (generally 0 indicates the command completed successfully; anything else indicates it didn't....there are exceptions!). Also, the actual compare for errorlevel is equal to or greater than which can present some challenges when checking the codes. Myname.bat Code: [Select]@echo off cls echo Hi, my name is %1 pause The %1 is a command line parameter. The number part indicates which parm from the command line to use. myname Jack myname Suzanne Each TIME the batch file myname is run, the first parameter on the command line is substituted for the %1 variable. myname Jack will output Hi, My name is Jack myname Suzanne will output Hi, My name is Suzanne Hope this helps a little. 8-) PS. Any good DOS book from the library should be ABLE to EXPLAIN this and MUCH more.thanks! |
|
| 4024. |
Solve : COPY MYFILE.TXT %userprofile%\Desktop??? |
|
Answer» I was on the internet, learning(TRYING to learn) about variables, but I still don't really get it. One of the examples were: Some environment variable like userprofile are preset by the operating system. To get a list of current environment variables and there values open a command prompt and type:If I did that set thing on my computer to create a variable, would it work on someone elses computer. (if not, is it possible to change it on more than 1 computer?)The SET command works only on the local machine. Keep in mind that the SET command does not list all the variables available. %date%, %time%, %cd%, %errorlevel% are all available on some machines but you won't find them in any SET listing. Generally variables that are SET, live only for the duration of the command or cmd window and variables SET in one window are not available in another command or cmd window. As always, there are ways to get around this. 8-)thanks :exclamation |
|
| 4025. |
Solve : Logging events in batch file? |
|
Answer» Hello all, I have created a simple batch file to restart multiple services on windows 2003 server. Pretty much I am just using net stop and start to accomplish this. What I need to know is how to copy the output in the batch file to a log. If you used net start and net stop before, can you not simply redirect these commands to the log? net stop servicename >> log net start servicename >> log I'm not familiar with the TPE service but you could also use the SC start servicename and sc stop servicename It is also possible to capture command window output but you would need a non-batch script for that. 8-) |
|
| 4026. |
Solve : If SIZE=0 then ...? |
|
Answer» Hello, |
|
| 4027. |
Solve : Output a file.Need Help!? |
|
Answer» how to use dos command to output a file (Ofile) from another file (Ifile) by reading position 10 to 12 in Ifile where it has value of 'XXX'Is your XXX is a word?hi, |
|
| 4028. |
Solve : Spaces in dos? |
|
Answer» If I were making a bat file, that would be copying a file, say the directory the file was being copied to was "C:\Theres a SPACE here". What would I put to replace the spaces, because putting just a space does not work right.Why do you want to replace the spaces, just put it in quotes and it will work.Also, you can use this, say you are in the C: drive and you want to GO to My DOCUMENTS, obviously its GOING to give you that annoying parameters thing, so on the system i have i always type |
|
| 4029. |
Solve : Bat file icons? |
|
Answer» Is there a WAY to change the icon of a .bat file?bat FILES dont have icons.....just script. |
|
| 4030. |
Solve : Windows me dos? |
|
Answer» In windows me my explorer shell was changed USING aston program. Something went wrong and now only a blue screen appears at boot. I was told it was possible to use a win 95 boot disk to remedy this problem. Is there someone who can tell me how to use this to access my system files and change my shell back to explorer? I believe it's located in the system.ini FILE. Thank-you for any and all help or suggestions.Try going into Safe Mode at boot (F8 before the Windows logo) and choosing System RESTORE to a point before this error began. It sounds like it was very recent. In windows me my explorer shell was changed using aston program. What is aston program? We need to get specifics on the issues.On looking, it's not a "DOS implant" for WinME but a shell replacement: http://www.astonshell.com/astonThanks for the responses. Yes aston is a shell replacement for windows, unfortunately it is not working for me. My comp. boots to a blue screen since there is no shell to load. If I could get into my system files somehow and change the shell back to explorer I think it would work out. Any advice on how to access files on an unresponsive computer from boot would be greatly appreciated. Thanks for the advice.Use a simple [highlight]boot diskette[/highlight] which contains Edit! More software with no purpose! Bling it on home to me! |
|
| 4031. |
Solve : Help me!(sidewinder?)? |
|
Answer» I dont understand this: In the below example the computer WOULD map the Z: DRIVE to the network PATH //computer/folder.what would you put for "computer"? Use the remote computer's name. If you right CLICK on My Computer==>Properties==>Computer Name tab you'll get the name of your computer. Using the same method on the remote computer, you can get what to use in a net use command. There are other ways to do this, but this keeps it simple. What kind of network is this? Good luck. 8-)THANKS for the help. I'm sorry but I don't know what you mean by what kind of network it is? |
|
| 4032. |
Solve : Re: please plsease help me? |
|
Answer» Double-posts will not get INFO faster. |
|
| 4033. |
Solve : Batch File Change Directory? |
|
Answer» Ok I'm not using DOS but I am using batch files through windows xp command prompt. |
|
| 4034. |
Solve : Operators? |
|
Answer» How to concatenate TWO strings in DOS otherwise what is the DOS command to concatenate two strings?Simply write them together. |
|
| 4035. |
Solve : RMDIR help? |
|
Answer» Can RMDIR /S /Q use wildcards? |
|
| 4036. |
Solve : How can I for directory access.? |
|
Answer» I need to check if I have access to a directory. I'm doing this now, by trying to create a file in that directory and then I'm checking if it exists. In Visual Studio post build event that returns an error if I have no access. I don't KNOW how to get rid of that error.To check access to a directory, why not just try to open the directory?What do you mean? I can navigate to the directory. I just can not create objects there. So my check has to figure out if I'm allowed to create folders there.It seems odd that you can access it and yet not create files. If access was denied, you'd get a message saying "Access is denied" when you TRIED to open the folder. |
|
| 4037. |
Solve : Redirect output of a command to variable? |
|
Answer» The BATCH script which I POSTED works for me. |
|
| 4038. |
Solve : Using network drives in a batch file? |
|
Answer» Hi |
|
| 4039. |
Solve : How to del files with /q and /f? |
|
Answer» for some reason this doesn't work:(am I doing it wrong?) |
|
| 4040. |
Solve : search for a string ina txt document using batch? |
|
Answer» i K now this is PROBABLY really n00b, but i was wondering how to search for a word inside a .txt document, using the if command. so far i have: |
|
| 4041. |
Solve : CAN SOMEONE PLEASE HELP ME? |
|
Answer» HI all. This is my 1st time here and i am a complete NOVICE with pc's so please bear with me. I have got programs on disks that i have been able to INSTALL and un-install without any PROBLEMS before but lately, when i try to install certain programs all i get is this message.... C:\WINDOWS\SYSTEM32\AUTOEXEC.NT. The system file is not suitable for running MS-DOS and microsoft Windows applications. Does anybody have any ideas as to why i am getting this problem Thankyou to anyone who can help me NikiHave a read .... It may hold the solution you are looking for ...... http://support.microsoft.com/default.aspx?scid=kb;en-us;324767 dl65 Thanks. will give it a try |
|
| 4042. |
Solve : dos and regedit? |
|
Answer» UMM.. is there any way to open regedit from a command PROMPT? The system is win2000 and its a school computer so THATS why i cant get to it thru run because run is disabled. can anyone help?if it's a school computer you probably should LEAVE it ALONE. |
|
| 4043. |
Solve : Copy entire folder structure? |
|
Answer» Is there any DOS command that can COPY entire folder STRUCTURE from source to DESTINATION.The normal copy command |
|
| 4044. |
Solve : setting ip address? |
|
Answer» hello all, i am harish and i am NEW this board. i have got quick question about the SETTING an ip address. is there any command to set the ip address from the DOS. well, it can be floolish question. but i really dont now. but one thing i can REMEBER that. when i was working on a ROUTER simulatore i use to use a command 'winipconfig'. to set the ip address but it dosnt WORK on a phycial system. can anyone help out in this. |
|
| 4045. |
Solve : installing cd rom in dos? |
|
Answer» Hey there guys, |
|
| 4046. |
Solve : DOS networking? |
|
Answer» Hi all, |
|
| 4047. |
Solve : WIN XP Format c: Without the Prompt? |
|
Answer» Running Win XP. Is there a switch that I can put after the FORMAT C: command in a batch file please. What is a comando for format drive c:\ ,if i only have 1 hdd ? You cannot format C: from within C: Travel to bootdisk . com and DLoad a bootdisk to perform what you want. patio. Is that you flame...ANd if win is instaled on drive d:\ ?Can you please repost your question.....in the windows section......and give most data/info to your PROBLEM.....I know its a destructive process. So I take it then that there is no 'switch' that can be added to a batch file after the Format [drive] command, to automate it, instead of operator input via the keyboard. like the DELTREE /Y or the RMDIR /S /Q Quote I know its a destructive process. So I take it then that there is no 'switch' that can be added to a batch file after the Format [drive] command, to automate it, instead of operator input via the keyboard. I have just checked on my BENCH test MACHINE which has a full VER. of DOS on it and there is no switch that can be added to the command line to accomplish this. patio. |
|
| 4048. |
Solve : Net Sending....? |
|
Answer» hello, at my SCHOOL we set send, and sometimes we "net SPAM" |
|
| 4049. |
Solve : CanNoPass UserLoginorDesktop OnlyDarkScreenAppears? |
|
Answer» The computer was turning on and off again and again so I disconnected the computer from the outlet. By the NEXT day the computer had not worked normally and UNTILL now I have not FIXED the problem. My computer still turns off by itself. My computer is a Tiger, windows xp, at least 3 G of memory and 1 to 2 G proccesor. I do not know what other information you need from me to help me with my problem. |
|
| 4050. |
Solve : I might sound like a n00b...? |
|
Answer» I believe there are Lynx binaries for real-mode DOS, and for CMD under Windows ... as well as the Linux TTY VERSIONS and more.I THINK you could download the Arachne DOS web browser, but I've never really USED it before though. Of course it's not a really a function of DOS that would load a webpage, it's just a program that can run in DOS.you can access a website! through a batch file!:Code: [Select]start http://www.google.caYou cannot access any website from any OS without a browser. MS DOS has no built in browser. If you make a batch file like this, it works:That's not getting a webpage in DOS that's just opening iexplore.exe (Internet Explorer), and opening google Canada.I'm outta here! http://www.howstuffworks.com |
|