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.
| 2201. |
Solve : Batch File using FORFILES to copy files within the last two weeks? |
|
Answer» Hi, |
|
| 2202. |
Solve : Is it possible to make a batch file write another one?? |
|
Answer» I want to create a batch file that can write another batch file.
http://www.ss64.com/nt/syntax-esc.html ***Escape Character ^ Escape character. Adding the escape character before a command symbol allows it to be treated as ordinary text. When piping or redirecting any of these charcters you should prefix with the escape character: \ & | > < ^ e.g. ^\ ^& ^| ^> ^< ^^ In the Statement ... Code: [Select]echo echo off ^& title Program ^& cls ^& pause > file.bat we are basically saying Echo text {ESCAPE} & (and now do this) Other command. Hope this HELPS. Quote from: nothlit on January 22, 2009, 02:28:03 PM we are basically saying Echo text {ESCAPE} & (and now do this) Other command. That's not true... we're saying echo [text] ignoring special characters because we've escaped them. without the ^ it would say Code: [Select]echo echo off [then do this] title Program [then do this] cls [then do this] pause FB Quote from: fireballs on January 22, 2009, 02:32:15 PM Quote from: nothlit on January 22, 2009, 02:28:03 PMwe are basically saying Echo text {ESCAPE} & (and now do this) Other command. Oops ... I knew what I meant just wrote it wrong. oh ok, thnx guys. Quote from: PirateSamir on January 23, 2009, 02:23:03 PM oh ok, thnx guys. Didn't confuse you did I? I hope 'fireballs' cleared up my goof quick enough that you understand. |
|
| 2203. |
Solve : Set Environment Variable? |
|
Answer» Is there any way to permanently Set an Environment Variable from within a BATCH script :-?. |
|
| 2204. |
Solve : Admin Account? |
|
Answer» Hello, |
|
| 2205. |
Solve : To Detect and To work in FOR files (BAT)? |
|
Answer» Hello, with MS-DOS I WORKED very LITTLE with Files for lots (BAT) or to program, and today I need to create a file since CONVERSOR.BAT that it carries out a task, I am working with Delphi7 (with one of their tools "brcc32" that transforms files creating resources of File.rc to File.res). My BAT, contains these lines: |
|
| 2206. |
Solve : Access? |
|
Answer» Hello, |
|
| 2207. |
Solve : random selection? |
|
Answer» if i set a range 0-9 how would i make a batch file ramdomly select a number 0-9 and ABCDEF (COLORS)??Quote if i set a range 0-9 how would i make a batch file ramdomly select a number 0-9 and ABCDEF (colors) You SEEM to have a serious misconception of what batch files can and cannot do. "make a batch file" and "randomly" are mutually exclusive terms in batch language. You can write a batch file that will allow you the user to test out all the possible color combinations for the cmd window: CODE: [Select]@echo off :start set /p id=Enter the color code: for %%a in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( for %%b in (A B C D E F 0 1 2 3 4 5 6 7 8 9) do ( if /i %id%==%%a%%b goto OK ) ) Echo Invalid Color Code...Try Again goto start :OK color %id% How's that online batch course you're taking? it is REALY helping i figered out the for loops a bit yesterday i can filter down serches with them now For the random number between 0 and 9 you can use Code: [Select]set /a rnd=%random% / (32767 / 10) echo Random number between 0 and 9 is %rnd%where can i get a list of all the variables like that ( %random% %errorlevel% %OS% ) and so on I found a list of them but it does not say how to use them so if you know of one that would be very helpfull just google it..one found here http://www.winnetmag.com/Article/ArticleID/23873/23873.htmli did goole it i found some like that but they did not have them all :-/how did you know they don't have them all? if you have doubts , check it out on microsoft site itself http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=trueThis is what i did to get i random letter and number Code: [Select]@echo off :start set /a rnd=%random% / (32767 / 16) if %rnd% EQU 10 set rnd=A if %rnd% EQU 11 set rnd=B if %rnd% EQU 12 set rnd=C if %rnd% EQU 13 set rnd=D if %rnd% EQU 14 set rnd=E if %rnd% EQU 15 set rnd=F if %rnd% EQU 16 goto :start set /a rnd1=%random% / (32767 / 16) if %rnd1% EQU 10 set rnd1=A if %rnd1% EQU 11 set rnd1=B if %rnd1% EQU 12 set rnd1=C if %rnd1% EQU 13 set rnd1=D if %rnd1% EQU 14 set rnd1=E if %rnd1% EQU 15 set rnd1=F if %rnd1% EQU 16 goto :start if %rnd% EQU %rnd1% goto :start set random1=%rnd%%rnd1% color %random1% goto :startOr simplified: Code: [Select]set HEX=0123456789ABCDEF :again set /a r1=%random% %% 16 set /a r2=%random% %% 16 call set rndcolor=%%HEX:~%r1%,1%%%%HEX:~%r2%,1%% color %rndcolor% goto:againOptionally use the getRandomColor function from: http://dostips.cmdtips.com/DtCodeCmdLib.php#getRandomColor: :again call:getRandomColor rndcolor color %rndcolor% goto:again Hope this info is useful |
|
| 2208. |
Solve : Limits? |
|
Answer» Hello, Hello, or you can use start /lowOk, Thanks Almn |
|
| 2209. |
Solve : My documents? |
|
Answer» HELLO, I would LIKE to know how to change the defult location of my documents to \\server\docs in batch. Thank You Almnthe registry key to change the default is HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Explorer\User SHELL Folders\Personal you can USE the reg tool to change it in your batchThank You Almn |
|
| 2210. |
Solve : Language? |
|
Answer» Hello, |
|
| 2211. |
Solve : arguments in ms dos? |
|
Answer» how do i write a batch file that takes in one argument and print it out ? |
|
| 2212. |
Solve : Generate number between 1 and 4? |
|
Answer» Is is possible in DOS to generate a NUMBER in a given range? Thank youAre you using the console of WXP or DOS 6.X ? |
|
| 2213. |
Solve : Run exe on remote machine? |
|
Answer» How can I run an exe on a remote machine? How can I run an exe on a remote machine? you can get psexec from http://www.sysinternals.com/Utilities/PsExec.html or if your remote has TELNET server, you can write a telnet script and CONNECT to the remote to execute your exeAlternatively, you COULD set up a scheduled task on the remote server which will execute the EXE under the user that has permissions to do so (or want). From your server, you'd execute the statement "SCHTASKS /Run [/S system [/U username [/P password]]] /TN taskname[/b]" Hope that helps you out.Solutions by Cameron and Ghostdog are good. Also look at the AT.EXE command, or even better, get SOON.EXE which is a FREE download from Microsoft. |
|
| 2214. |
Solve : OS? |
|
Answer» Hello, |
|
| 2215. |
Solve : Close a file from within a called batch file?? |
|
Answer» Is there a way to explicitly close a file from within a called BATCH file? |
|
| 2216. |
Solve : DOS cd boot with more NIC drivers?? |
|
Answer» Hi! I've got a FLOPPY setup here that works ok. It boots and logs on to the domain and maps up a share from the fileserver and automatically runs Ghost.exe from the fileserver. |
|
| 2217. |
Solve : Re: the purpose of>>>>>? |
|
Answer» C'mon - do your own homework!!! |
|
| 2218. |
Solve : Re: PC goes to power saver mode? |
|
Answer» Check for POWER settings in the BIOSIf you have no O/S then you cannot have DOS. (That IS an operating system!) |
|
| 2219. |
Solve : No OS but DOS problem.? |
|
Answer» Hello. |
|
| 2220. |
Solve : Cleaning Crud Off Hard Drive? |
|
Answer» The point of viewing the sites listed, would be for this guys parents... underage.... not out of school even! It is up to my husband though, it is his family. I just told him I would FIND out what exactly was viewed, so we would know for sure... he had already cleared the history by the time we found out. Thanks for all of the help! I will try this, but it will be monday probably, we will be out of town. I'll let u know if I cant get it! Thanks again! KJ - the site you posted is very interesting but look at the date of the info: The point of viewing the sites listed, would be for this guys parents... underage.... not out of school even! It is up to my husband though, it is his family. I just told him I would find out what exactly was viewed, so we would know for sure... he had already cleared the history by the time we found out. Thanks for all of the help! I will try this, but it will be monday probably, we will be out of town. I'll let u know if I cant get it! Thanks again! I have been watching this topic now for several DAYS and I am really trying to FIGURE out , who is the most upset over the incident ........ You and your husband or............ the parents of the underage ... not out of school yet person. Quote he had already cleared the history by the time we found out.This sounds like it was the young person who cleared the history .... and if it was , that suggests to me that ....he or she has done this before and has enough computer skills to remember to attempt to cover up their tracks ...... Kids will do these sort of things be it intentional or by accident . Frustrating as it may be , thats life ......... Can the info someones apparently wants to recover be recovered .............. Possibly , but it will be a fairly costly procedure . The fact that CCleaner was installed and run suggests that most of the evidence has already been comprimised and depending on how ccleaner was set up , may well be unrecoverable. Further , the fact that the machine used by the youngster ...... is ( has ) been in use since makes it even more difficult to recover anything which have remained . There are of course forensic recovery specialists who have very sophisticated software at their disposal ..... but as stated above is very expensive. The best thing you and you husband can do would be to install a keylogger on your machine and suggest to the parents of the youngster , that they do the same thing .....and then every keystroke that is made on the machine is recorded in a well hidden file for inspection at any time ....... If you are concerned that there is all this nasty stuff hidden deep in the bowels of your machine ........ Do as has been suggested much earlier and save anything of importance from the machine and then do a full format and a complete reinstall ....... Now its clean....... all gone ..... until the next time . I hope this assists you and your hubby in understanding a bit more about computers. dl65 >>>then look at this video hope it helps get it here copy and past link http://www.freewebs.com/fragit/vid.zip Dakota... I can not get this to open... >>>>I have been watching this topic now for several days and I am really trying to figure out , who is the most upset over the incident ........ You and your husband or............ the parents of the underage ... not out of school yet person dl65... Both parties are upset. The thing is that he cleared the history, but i was cleaning up some space on the computer and checked the temp files, and found this crud. The parents have not touched their computer(as far as cleaning off goes) b/c it has been taken away and not touched. Ive heard about he key loggers, but I cant decide. Ive downloaded a few to try, but IF POSSIBLE I do not want to pay for it. I know that there are freeware sites out there... a friend of mine has a key logger that WAS free... now they chare $70! If is is a good ONE, I do not mind shelling out cash, but there are so many, i am not sure which one to get. it works for me you have to copy and past the link it will not work if you click it OK! All I can say is WOW! I didnot know you could make a video like that!!! Thanks! I have not been able to try it yet, but I will! Any suggestions for a good keylogger? :-?The best program I have found for monitoring computer / email / internet usage is Spector Pro by SpectorSoft: http://www.spectorsoft.com/products/SpectorPro_Windows/index.html It logs keystrokes It logs incoming and outgoing emails It logs every web site visited It logs chats and IM It takes periodic screen shots ... and more And by default it installs in "stealth" mode so nobody else even knows that it is installed. You can VIEW the logs from the computer it is installed on, or from any other computer on the network. You can find some programs for cheaper, but this logs the most information, works with the widest range of programs and webmail and is best that we have used by far. We install it for lots of parents, and we have installed the network version for several corporate customers.!! Is there anything this great, that is not so expensive? $100 for occasional use is hard to do.... is this always on sale like this? $50 off is pretty good, but i was hoping to not have to spend the $50 :-?Sometimes quality software costs $$$. Look what MS gets for their stuff! This is a bargain, if you want a good keylogger, though. There are freeware things you can try as well. Just google for "free key logger". |
|
| 2221. |
Solve : Ip's? |
|
Answer» are you behind a ROUTER, if so how many??YES I am behind a router,a linksys router. cd desktop (press enter)then send that text file to me in an email (pm me for my email) ok ok Thanks AlmnDid it work :-? if you need any moor help with anything just ask. Obviously it works AlmnQuote f you are only behind one router and this is for you only (or any computers on your network you could use tracert so it would look like this: What if I am behind more than one router ?? Thank you Almn |
|
| 2222. |
Solve : how will the command.com go about the execution? |
|
Answer» of the command given in the following situation: |
|
| 2223. |
Solve : Hrm... escape sequence?? |
|
Answer» I'm trying to write a batch file to created a folder on a BACKUP drive with the output of date /t as the folder name. |
|
| 2224. |
Solve : running bat on remote machine? |
|
Answer» Hi- |
|
| 2225. |
Solve : open a file? |
|
Answer» Hi all! Is this the only way? Of course not, there are always alternative ways to do anything on a PC. Consider: Code: [Select]Const ForReading = 1 Set FSO = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile("c:\program files\temp.txt",ForReading) R = f.ReadAll WScript.Echo r f.close After saving the script with a vbs extension, run as cscript scriptname.vbs Is ONE better than the other? That's your choice. 8-)There are many ways. Here are a couple more using almost your exact code: Code: [Select]FOR /F "delims=" %%s in ("C:\Program Files\temp.txt") do echo %%s Code: [Select]FOR /F "tokens=*" %%s in ("C:\Program Files\temp.txt") do echo %%s |
|
| 2226. |
Solve : restarting in ms dos? |
|
Answer» k since this other pc has 129 mb and i want to make it a pc for w/e im gonna install window 98 on it?good idea? the pc came with windows 200 or me and my freind instlled xp and he kept all the old files so the pc is all messed up .k i pop the windows 98 cd and it says reboot in ms dos mode or somethin like that i restarted the pc and i didnt see anythin that had to do with ms dos mode,so i am stuck how do i restart in ms dos mode?ty any help is appreciatedPlease post the pc specs, Ram, HDD, floppy drive etc. |
|
| 2227. |
Solve : Using environment variable string substitution? |
|
Answer» I know how to use string substitution in a WinXP command shell using the set command with the syntax |
|
| 2228. |
Solve : Math functions in DOS? |
|
Answer» Is there a way to multiply two environment variables in DOS? I have generated two random variables that I now want to multiply to generate a LARGER random NUMBER. Thank you.DOS does not do arithmetic. However the cmd processor under Win2000 and WinXP (MAYBE even WinNT) has facilities for doing simple math. |
|
| 2229. |
Solve : MSDOS command directory changes.? |
|
Answer» Can't remember this one! |
|
| 2230. |
Solve : Question about "change directory? |
|
Answer» HI there, I just want to ask a why question. I KNOW how the stuf works but I can't explain, so perhaps somebody can help me. If I want to run this Code: [SELECT] del c:/documents and settings/my username/test/*.* I get the error (I can't translate it, but I don't the the kind of error mathers) Quote Ongeldige schakeloptie - documents. But if I use Code: [Select]cd c:/documents and settings/my username/test/ del *.* It does work, how is this possibleSimply because CD can cope with spaces in a name, where DEL cannot; if you type del "c:/documents and settings/my username/test/*.*" it WOULD work Graham |
|
| 2231. |
Solve : java in dos? |
|
Answer» can we WRITE a JAVA PGM in dos prompt itself and can we RUN there itself :-?Start here... |
|
| 2232. |
Solve : command/y/c not working under XP? |
|
Answer» Greetings. |
|
| 2233. |
Solve : Mapping? |
|
Answer» hello |
|
| 2234. |
Solve : xcopy cached file? |
|
Answer» Hello, |
|
| 2235. |
Solve : MsDos doesn't recognized Build command!? |
|
Answer» hi i was trying to compile a .sys file so i try to create new file but while they're trying to build |
|
| 2236. |
Solve : Or?? |
|
Answer» Hi, I haven't worked in DOS for YEARS. Can someone remind me of the or command? |
|
| 2237. |
Solve : Suggestions required.? |
|
Answer» Hi all, |
|
| 2238. |
Solve : Concat the SYSDate to a output filename? |
|
Answer» Could someone share with me how to Concatenate the SysDate to a Output file from a executing Bat file. |
|
| 2239. |
Solve : Installing Windows 98 SE from DOS? |
|
Answer» After someone recently decided to format the hard drive in a computer, I have been TRYING to get it back up to working order. This computer was not originally installed with Windows 98 (if that even matters.) My plan is to use a DOS bootdisk, and from there use a few cd commands to get to the CD's setup file, and to go from there. My questions are, will this work? And how come, when I try to brush up on my DOS commands using the command prompt, I can not change directories into the DVD drive (it doesn't say that it cannot find the PATH, it just does nothing and skips to the next line.) Am I missing a command? I plan to use a DOS boot disk (I assume the latest version) and execute the setup from there. With no floppy drive??? Look here: http://home.ptd.net/~don5408/win98/install/clean.html |
|
| 2240. |
Solve : Stripping CRLR Characters? |
|
Answer» Hello, I have a file called x.txt containing an ip ADDRESS 192.168.200.100 followed by a return character. I have a file called x.txt containing an ip address 192.168.200.100 followed by a return character By typing out such a file, you WOULD get the IP address followed by a blank line. How was x.txt CREATED? I fail to see why the HIGH order character is getting dropped. 8-)Do this Code: [Select]@ECHO off for /f "tokens=1-5 delims= " %%a in (ip.txt) do echo %%a %%b pauseI had a text file that looked like this 152.135.12.45 k and it returned all of it |
|
| 2241. |
Solve : DOS command for remove directory? |
|
Answer» i would like to create a batch file to delete a directory as well as the subdirectories and FILES inside... |
|
| 2242. |
Solve : Copying to CDROM using DOS commands? |
|
Answer» Does anyone know what the DOS command is to copy files, folders and sub-folders to a CDROM using DOS commands in a batch FILE? Iv'e been using xcopy to copy to another folder on the HD but it is an extra step I do not wish to take to get it on a CDROM.It is not possible to copy files with xcopy to a CD-burner. |
|
| 2243. |
Solve : Installation of Win 98 SE? |
|
Answer» I was installing Microsoft Windows 98 and a black square appeared in the middle of the screen any ideas what its aboutSounds like the astrologers black hole. |
|
| 2244. |
Solve : telling a remote pc to open a program? |
|
Answer» You can start it with the at (command scheduler) on the CLIENTS. |
|
| 2245. |
Solve : Deleting from file extensions? |
|
Answer» I want to create a BATCH FILE that searches files with the .tmp extension and delete all of them [ OS -> Win98 ]. SOMEONE can help ? Quote Code: [Select]@echo offThanks .That and .chk extension are pretty useless to me after I reboot. [ that was a REALLY fast reply ! ]no problem any time you need help just ask!@echo off del C:\*.tmp /s del C:\*.that /s del C:\*.chk /s |
|
| 2246. |
Solve : load program? |
|
Answer» I am fairly ignorant when it comes to DOS so bare with me. I am trying to load a program that is DOS based. My internal A drive does not WORK so I PURCHASED an external floppy drive. The problem that I have is that the disk is programmed to read from an A drive and I don't seem to have any way to CHANGE that. Is there some way around this? Thanks!You would be better served with a replacement internal floppy rather than trying to force USB to work on a DOS system.I tried that, but was told that it is a problem with my mother board and that is quite a bit more costly.Is the external floppy drive recognized by your computer? In real DOS mode? Dos prompt under Windows? What versions of DOS/Windows are you using?Yes, DOS does recognize the program and starts to load it, but STOPS when it gets to the part where it says loading from A to C. It then tells me that there is no disk in drive A even though it read from the external floppy drive to GET the files. I use XP.Try using the subst command. For example, if your external drive is D: you use subst a: d: . The command is only good until you log off or shut down, so a simple batch file in the startup folder will reinstate the command. |
|
| 2247. |
Solve : Small batch program needed? |
|
Answer» Hi Friends, |
|
| 2248. |
Solve : DOS FONT? |
|
Answer» hI |
|
| 2249. |
Solve : IF string1==string2 help...? |
|
Answer» Hi guys, I'm new here and I have a question. Created by xstax981Code: [Select]@echo off title Battlefield 2 Patcher v1.03 color 80 :: Excuse all the spelling errors; they're there to make the interface more user-friendly. :: I'm tired of having to guess what these commands mean in PATCHER.bat. I'm gonna fix that! cls set goodcopyright=Created by xstax981 for /f "tokens=1,2,3 delims= " %%a in (readme.txt) do set copyright=%%a %%B %%c if "%copyright%" EQU "%goodcopyright%" goto :START goto :FALSESTART :START :: Basic start of patcher. Also scans if PATCHER.bat is placed with the BF2.exe file. echo. echo. *************************** echo. Battlefield 2 Patcher v1.03 echo. *************************** echo. Created by xstax981 echo. pause :FALSESTART :: What to call if the author's copyright is removed. title Illegal Version echo.You have a modified version of this program that has the original author's echo.copyright stripped. This program will now terminate. pause exit Tell me how that works for you. if you need anything changed just tell me It works, but even now if the "readme.txt" is there with the first line being "Created by xstax981", it gives ME a bad copyright notice . Ironic as I am the original author loldoes it goto the first part then goto the ilegalcopy part or just the ilegal copy part :-? Look at this file this is how i have it and i WORKE for me this way.tell me how that works |
|
| 2250. |
Solve : goto? |
|
Answer» Hello, |
|