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.
| 6451. |
Solve : link? |
|
Answer» how can i CREATE a link in a batch file to a WEBSITE, that starts at 20:00Maybe this will help: |
|
| 6452. |
Solve : Batch to refresh IE? |
|
Answer» I don't know all that much about batch FILES, but what I'm trying to do is make a batch that will refresh internet explorer about every 10 seconds...I'm doing it for my Dad for his FARM markets. If ANYONE could help me out or give me somewhere to start it would be really appretiated. |
|
| 6453. |
Solve : Create directorylist of the last XXX? |
|
Answer» Hello, |
|
| 6454. |
Solve : batch file hrm...? |
|
Answer» daj0pe, either that.. or is somebody can be nice enough, CREATE me a VB app, where i can enter a date (defaulting to today) and it will tell me the date in 120 days? heheif you don't MIND vbscript and if i am not wrong, there is a DateAdd function in vbscript that you could use.you GUYS rock ) works perfect thanks for your time!! |
|
| 6455. |
Solve : Batch file help!? |
|
Answer» So, I've recently dug out my old copy of Doom ][, installed it, patched, and downloaded ZDoom. WAD Name: [where I type the name] And upon pressing enter, would just load the proper commands. Is there any way to do this?Like this? Code: [Select]:: wadload.bat :: ZDoom WAD Loader @ECHO OFF set /p name=Enter the Name: C:\Games\ZDoom\zdoom.exe -file %name% Does it help?Code: [Select]:: wadload.bat :: ZDoom WAD Loader @ECHO OFF set /p name=Enter the Name: C:\Games\ZDoom\zdoom.exe -file %name%.wad EXIT Thanks man! THREW in an EXIT there because the prompt is pretty much useless after I enter the name in. Also made it so the the .wad is already typed for über-laziness FACTOR. |
|
| 6456. |
Solve : Network Drive Mapping? |
|
Answer» I apologize in advance if its somewhere on here, but I've only found similar issues, but none that meet my need. |
|
| 6457. |
Solve : Batch file help, passwords? |
|
Answer» Ho people im writing a batch file or a few so may need alot of help. |
|
| 6458. |
Solve : Recovering files and dates? |
|
Answer» Ok, I have a problem that I need some help with. I hope SOMEONE here can help... I am in the middle of a mess. My personal computer(yes, mine) was MISUSED by my ex. I know what was viewed on the internet, and now for sake of the divorce, I need to know WHEN it started. Is there a way to get into the DOS mode and recover that? The history and temp file were cleared... but I know you can recover all the sites ever visited, and papers ever typed in Word ECT.... can you get dates? and possible a backup file of the internet sites? maybe even e-mails? Even if someone COULD tell me how to boot up in DOS mode to clean this junk off would be great!! I do not want to go pay $200 for someone else to do it and risk LOOSING anything I want left alone. Any help is appreciated! |
|
| 6459. |
Solve : XCopy folders with relative paths!? |
|
Answer» Hi All set sourcedirMSI=K:\lang\10.0.1245.7777_Unique_name_lang\Something_else\file.txtthey are set in stone. Would you not need to use the wildcards in the DIR command to create a collection of files or directories for the XCOPY to operate on? Like I said, maybe I'm missing something. :-?Sorry Sidewinder, you're right! From that example it looks like is a set path! I just wanted to show how the folder looks with the full path. My humble apologies. Indeed, those numbers are changing. I need something like a wildcard or anything that would ignore those numbers and look only at what's after it _Unique_name_lang\Something_else\file.txt, copies only file.txt, including the dirs it come from too, into C:\test.. I hope I'm not getting more confusing... Thanks SoncuHow about this: Code: [Select]set sourcedirMSI=Something_else\file.txt set sourcedirCAB=Something_else\file.xml set backupdir=C:\Test FOR /f "tokens=*" %%a in ('dir /ad /b \\server\path\*^|findstr _Unique_name_lang$') do ( if exist "%%a.\%sourcedirMSI%" xcopy "%%a.\%sourcedirMSI%" "%backupdir%" /s /e if exist "%%a.\%sourcedirCAB%" xcopy "%%a.\%sourcedirMSI%" "%backupdir%" /s /e ) DOS IT HELP?Thanks for the help DOSItHelp but unfortunately your suggestion didn't work! Here is an example of the full path: \\server\path\10.0.1234.7777_Unique_name_lang\Something_else I need to bypass "10.0.1234.7777", read "_Unique_name_lang" and xcopy all the files with file.txt/xml found in all the subdirectories. Thanks, SoncuHow about this? Code: [Select]set backupdir=C:\Test FOR /f "tokens=*" %%a in ('dir /s /b \\server\path\*^|findstr _Unique_name_lang\\') do ( if /i "%%~nxa"=="file.txt" xcopy "%%a" "%backupdir%" /s /e if /i "%%~nxa"=="file.xml" xcopy "%%a" "%backupdir%" /s /e )[highlight]; )[/highlight]Hi DosItHelp That works fine, but it only copies the files in the C:\Test folder in the root. I need the directories recursively as well. The /s/e switches don't seem to work. Thanks again Soncu How about this? Code: [Select]set backupdir=C:\Test FOR /f "tokens=*" %%a in ('dir /b /ad \\server\path\*^|findstr _Unique_name_lang$') do ( xcopy "%%a.\file.txt?" "%backupdir%" /s/y xcopy "%%a.\file.xml?" "%backupdir%" /s/y )[highlight]; )[/highlight]Thanks a lot DosItHelp! With a bit of tweaking it worked fine! How about making it to extract the files newer than 2 days without setting a fixed date! Cheers Soncu Soncu, This will be a little more tricky. Try this: set TmpFile=%temp%.\%~n0.tmp type NUL>"%TmpFileList%"&REM makes sure tmpfile is empty set backupdir=C:\Test FOR /f "tokens=*" %%a in ('dir /b /ad \\server\path\*^|findstr _Unique_name_lang$') do ( xcopy "%%a.\file.txt?" "%backupdir%" /s/y/L&REM L-option Displays files that would be copied xcopy "%%a.\file.xml?" "%backupdir%" /s/y/L&REM L-option Displays files that would be copied )>"%TmpFile%" SETLOCAL ENABLEDELAYEDEXPANSION set /a AgeInDays=2 call:jdate tnow "%date%"&REM get today in julian days for /f "tokens=*" %%F in ("%TmpFile%") do ( call:ftime tfile "%%F"&REM get file time in julian days set /a diff=tnow-tfile if !diff! LEQ %limit% xcopy "%%~F" "%backupdir%%%~F" ) PAUSE GOTO:EOF :: Goto http://dostips.cmdtips.com/DtTipsDateTime.php :: Copy :ftime :jdate :date2jdate functions below here [/b] You will need to get the functions [highlight]:ftime[/highlight] [highlight]:jdate[/highlight] and [highlight]:date2jdate[/highlight] from: [highlight]http://dostips.cmdtips.com/DtTipsDateTime.php[/highlight] Hope this helps |
|
| 6460. |
Solve : 2 DOS Questions? |
|
Answer» I am running Windows XP and want to know if there are any commands in DOS for |
|
| 6461. |
Solve : Excluding files when using dir command? |
|
Answer» I need to output all the folders within a SPECIFIC directory, including subdirectories. However, I don't want to output all the contents of the directories - I just want the directories and subdirectory names. I know that with the dir command, it will display all files and subdirectories, but is it possible to exclude all the files? |
|
| 6462. |
Solve : TOUGH!replace text in file where text like hello*? |
|
Answer» Hello 1.search all files in c:\ and its subdir with the name text.txt set pathToDirs=c:\test 'dir "test.txt" %pathToDirs% /s/b' This may work a LITTLE better but Ghostdog is right. Batch code is not a programming language and data manipulation is easier is any of free Windows scripting languages VBScript, JScript, Python, Rexx, etc. Code: [Select]setlocal enabledelayedexpansion set pathToDirs=c: set tmpfile=%TMP%\abc.123.aux if exist %tmpfile% del %tmpfile% for /f %%d in ('dir %pathToDirs%\test.txt /a:-d /s /b') do ( call :REPLACE_TEXT %%d hello goodbye ) goto :eof :REPLACE_TEXT for /f "delims=" %%x in (%1) do ( set tmp=%%x set tmp=!tmp:%2=%3! echo !tmp! >> %tmpfile% ) move /y %tmpfile% %1 > NUL Good luck. 8-)Quote if the string is "greet=hello" i don't want to change it. setlocal enabledelayedexpansion set pathToDirs=c: set tmpfile=%TMP%\abc.123.aux if exist %tmpfile% del %tmpfile% for /f %%d in ('dir %pathToDirs%\test.txt /a:-d /s /b') do ( call :REPLACE_TEXT %%d [highlight]"greeting=hello" "greeting=goodbye"[/highlight] ) goto :eof :REPLACE_TEXT for /f "delims=" %%x in (%1) do ( set tmp=%%x set tmp=!tmp:%[highlight]~[/highlight]2=%[highlight]~[/highlight]3! echo !tmp! >> %tmpfile% ) move /y %tmpfile% %1 > NUL [/b] Have fun |
|
| 6463. |
Solve : Closing...? |
|
Answer» :-? how do you close a specific active program using dos? tskill will close all of the instances - but i only want to kill one - ie. two notepad text files are open but i want to close only the FIRST.... |
|
| 6464. |
Solve : How to create a batch?? |
|
Answer» I have a program (program.exe)(running on WinXPpro) which STARTS by opening a dialog with two text fields in which I have to type some code - example: 123456789 in the first box, and 987654321 in the second box and then click OK to actually start the program. Although I'm not new to computes, since Norton Commander and Wordstar, I'm not familiar with batch files and commands. I'm TIRED of opening the program, and then the text file CONTAINING just the two LINES with numbers and then copy and paste it, one by one, into the BOXES, and I was wondering if this could be done by excuting a batch file. By now, I've just managed to write a batch which starts the "program.exe" together with "notepad.exe" opening the text file containing the code, so the copy/pasting is easier, but, can I do something more? This batch file, I assume, should first start the program, then get the first line of numbers from the text file and paste it into the first textbox, and then the second line of numbers and paste it into the second box. Or should I create two separate text files, each one containing one of the lines? |
|
| 6465. |
Solve : DOS disk commands? |
|
Answer» I am not familiar with DOS COMMANDS. I have a DOS disk to INSTALL Windows ME, but once I get to A:\ I have no clue as to what commands I need to start the installation! Can anyone out there help? You're going to need a LOT more help than that: |
|
| 6466. |
Solve : Dump errors from a batchscript in a log-file? |
|
Answer» Hello everyone, |
|
| 6467. |
Solve : FTP'ing? |
|
Answer» Hello all, |
|
| 6468. |
Solve : application file? |
|
Answer» Glad i could be of some HELP, |
|
| 6469. |
Solve : Need some help..? |
|
Answer» I don't know that much about DOS or WINDOWS..or ANYTHING. im not /that/ computer literate. But i downloaded the shareware of Quake, and im not sure how to run the PROGRAM. Any information you need i'll gladly tell, im just not sure what to say.Wahotts....... Are you refering to the game ? If so go to the website ........ or post in the Games section . |
|
| 6470. |
Solve : how do you check to see if a program is running?? |
|
Answer» tskill ends a program, but how do ou check to SEE if it infact running? (using commands not taskmanager)TaskList outputs a nice DISPLAY of running processes |
|
| 6471. |
Solve : hmmm.. can i ask more?? |
|
Answer» in win ME, can i ask if what other functions the "rundll.exe" aside from shutting down or restarting the computer.. |
|
| 6472. |
Solve : A counter in DOS? |
|
Answer» I use Windows 98 |
|
| 6473. |
Solve : a simple question? |
|
Answer» i think this is a silly question but still i need to know the answer.. hehe I added a new path using the "path" command.. but then, when i restarted cmd.exe, it was erased.. also in autoexec.bat, i added a few lines but then when i restarted windows, the lines i added disappeared.. kindly help me with this.. hope to hear from you GUYS soon and thanks Mixed signals. If you have CMD.EXE it's doubtful you have a AUTOEXEC.BAT FILE. Where did you add this new path? At the command line? In a batch file? In Windows? Today everyone seems to be taking the wrong path.LOL, for what it's worth I have a shortcut to cmd and in properties I changed the 'Start In' to c:\winnt\system32 (W2K) instead of the 'user' start in directory.I just have MINE at the root of C:. But I've written a few one-line batch files to quickly navigate to places like My Documents, the desktop, etc. In the command line.. I tried it both on the command prompt of dos and xp (command.com and cmd.exe) - if that's what you would like to know :-/Based on previous responses I'm not SURE what you want to do. CHANGING the path inside a command or cmd window is only in effect for the life of the window. To change the path permanently: Right click My Computer==>Properties==>Advanced==>Environment Variables Edit the PATH variable in the System Variables section and OK your way out. To change the directory where the CMD or COMMAND window starts, take Fed's advice and create a shortcut to command or cmd and in properties change the 'Start In' box to whatever directory you want. Hope this helps. 8-) |
|
| 6474. |
Solve : processing of files with a batch file? |
|
Answer» I want some insight. I need to process several input files using batch file. Input files are having a particular naming pattern. Say files are having names LIKE How can I change the file name in the batch file? after reading the question, all you want to do is change file name? basically you can change filename using ren or move command. But i GUESS your problem is not as simple as that... |
|
| 6475. |
Solve : Recover files from 'recycle bin' using cmd prompt? |
|
Answer» Hi, im new here and I am having trouble with my computer. cam_s1..... Do you have any idea which file you deleted ? Yes I know exactly which file i deleted (and what directory it is located in) Yes I have tried to boot in safe mode but it comes up with the same MESSAGE as when trying to use normal mode Operating system: Windows 98 Second Edition EDIT: by the way the file is: C:\WINDOWS\system\VMM32\IOS.VXD Another solution could be by someone else posting this file (in a ZIP file) so I could copy it to its original location and hope that it works.Before you attempt to recover a file from the Recyle Bin please READ this. You cannot recover your file using its original path/filename as it will have been renamed. Try running SFC from the command prompt, it might work. Good luck Yes it WORKED. thanks for that info on the recycle bin. I opened the directory of the 'hidden' recycled folder and the file was sitting right there, so I copied and renamed back to its orginal place and eureka! it workedCam_s1 - thanks for getting back to us with your good news, most posters don't come back to let us know if our suggestions were successful or not. D... |
|
| 6476. |
Solve : MS-DOS Corrupted?? |
|
Answer» Hello Everyone. This is my first time posting here, im having some rather minor problems with my computer that just keep bugging me. I have looked EVERYWHERE, looked at every tutorial, called Microsoft and Dell numerous times, looked on every computer forum imagninable...nothing. Version 5.1.2600sounds like an XP machine. Check your path by entering path at a command prompt. Make sure the C:\Windows\System32 directory is included in the path. If not you can add it permanently by right clicking My Computer==>Properties==>Advanced==>Environment Variables and then editing the PATH in the System Variables section. It's not the downloading so much as executing the downloaded files. Whatever you do, do not use any programs from a MS-DOS 5.0 disk. The reason some programs work and others don't is some commands are internal to the CMD processor and others are external files which CMD cannot find.Quote QuoteSorry, i forgot to add, the computer is running XP.Version 5.1.2600sounds like an XP machine. Check your path by entering path at a command prompt. Make sure the C:\Windows\System32 directory is included in the path. When i typed in path, it said... "PATH=%SystemRoute%\System32;%SystemRoute%;%SystemRoute%\System32\Wbem" Then there was alot of other stuff. So, is that ok? Or is that not the right one? So, where can i find these external files? I was hoping i could atleast get "ping" and "ipconfig" working for now.Is this the English version of XP? If not all bets are off. Quote "PATH=%SystemRoute%\System32;%SystemRoute%;%SystemRoute%\System32\Wbem" Not sure, but if you run set from the command prompt I'm pretty sure you will not find a variable called %systemroute%. Try changing %systemroute% to %systemroot%\system32 If you run a DIR command from the c:\windows\system32 directory you should find PING and IPCONFIG. The PATH variable sets up a directory search order for CMD to follow when LOOKING for programs and the PATH must be synchronized with the variable names in the environment or hardcoded. Hope this helps. 8-)Yes, it is the english version of XP, or i would suppose so...seeing as everything is written in english Quote If you run a DIR command from the c:\windows\system32 directory you should find PING and IPCONFIG.Ok, so, i typed in dir C:/windows/system32 So many things actually came up that it would not let me scroll up to view them all However,if i clicked the scrollbar, i could stop it from scrolling, i did that and found ipconfig.exe as well as ping.exe thats what i needed im GUESSING? However, i did not understand this at all: Quote The PATH variable sets up a directory search order for CMD to follow when looking for programs and the PATH must be synchronized with the variable names in the environment or hardcoded. So...what should i do now? I apoligize for being such a noob Im trying here. This is what came up when i typed in set...mabey this will do you more good then its doing me. Thank you so much. Also,i went into system 32, found ipconfig.exe and ping.exe and clicked as to run, and they still do the same thing...cmd pops up for mabey half a second(NO time to read what is written,but there was somthign there) and EXITS, same with ping. It seems to be doing this for alot of(not all) .exe programs in system32. Your path path=%systemroot%\system32 and your systemroot=C:\windows statements check out just fine. When the CMD environment is setup the symbolic %systemroot% will resolve to c:\windows and the path will be set to c:\windows\system32. Using windows explorer and doubleclicking any command found in system32 will open a cmd window, run the command and then close the window. The same result will occur if you type in a command from Start==>Run. Are you opening a CMD window and then typing the command (IPCONFIG or PING) from the prompt? If you type path at a command prompt, does %systemroot% get expanded to c:\windows? A bit flustered why CMD cannot find valid commands. :-? Quote Your path path=%systemroot%\system32 and your systemroot=C:\windows statements check out just fine. When the CMD environment is setup the symbolic %systemroot% will resolve to c:\windows and the path will be set to c:\windows\system32. Tried it from RUN. Like i said previously, the window opens for .5 sec and says somthing then exits. I see that it said somthing...however it exited far to fast to read. Quote Are you opening a CMD window and then typing the command (IPCONFIG or PING) from the prompt? If you type path at a command prompt, does %systemroot% get expanded to c:\windows? Weird huh? Everything seems to be in working order, yet nothing works Could it be a corruption with cmd itself? Just having issues executing .exe files?Very weird. Microsoft turned up symbolics not being able to get resolved due to dependencies...which I don't see any in your case. The easiet way to fix this would be to hardcode the directory names in the environment; the ones in question are all pretty standard anyway. Right click My Computer==>Properties==>Advanced==>Environment Variables Edit the PATH variable in the System Variables section by replacing occurances of %systemroot% with c:\windows. Retain the same punctuation; spelling counts; and values are case insensitive. Good luck. 8-)Quote I SWEAR YOU ARE JESUS! That did it, first shot. No wonder they made you a mod...perfect!!!!!!!!!! Man,im such a computer geek! Well,it works fine now! Thank you so much for your help, honestly!! I may be back again with other computer problems, and ill read...but i probabley wont post much, seeing as far as computer softwhere, im a noob Thanks a bunch! Sincerly, Adam |
|
| 6477. |
Solve : How to close another program from Dos Batch file? |
|
Answer» Instead of the boring beep, I wanted to ADD C:\WINNT\Media\notify.wav to my batch file to notify me when the process is complete. After the wav sound has PLAYED, is there a WAY for me to close the window for wmplayer.exe? Is there a way to send "Alt+F4"? |
|
| 6478. |
Solve : USB keyboard on DOS? |
|
Answer» Hello everyone, |
|
| 6479. |
Solve : dos (win98)? |
|
Answer» hi master's |
|
| 6480. |
Solve : Cannot find FCBS? |
|
Answer» Hi, Does FCBS work even without installing MS-DOS, like in my case? You do indeed have DOS on your system. In fact Win98 runs on top of DOS. I also recall an option to restart a Win98 system in MS-DOS mode. Whether you boot into Win98 or DOS in full screen mode, the CONFIG.SYS file is processed and FCBS defaults to 4 if not present. Did you put a FCBS=40 statement in your CONFIG.SYS file? Did you reboot? What was the SCBS=40,40 in your original post all about? 8-) It is a very old Dutch program for bookkeeping and has a test to check the settings for share and fcbs. It's OK now because I used the config.sys in C: to add scbs but it ought to be config.sys in Windows\system32 actually. So, it works and thanks for the help! Kees |
|
| 6481. |
Solve : How to set a variable with the current path?!? |
|
Answer» I'm developing an APPLICATION and i need to SET a variable with the current path for that aplication (it can be anywhere in the computer) after that i have to invoke the application itself. |
|
| 6482. |
Solve : Creating Text Files using DOS? |
|
Answer» Hi, I was just wondering if it's possible to create some sort of batch file that will create a text file and allow me to insert text into that file after it has been created? Hi, I was just wondering if it's possible to create some sort of batch file that will create a text file and allow me to insert text into that file after it has been created? You use the echo command in a batch file, and follow it with redirection, so that instead of echoing text to the screen, it is redirected to a file. For example: echo Some text here > textfile.txt Would create a file named textfile.txt and in it would be Some text here If the FILENAME textfile.txt already existed, it would be overwritten. Or: echo more text here >> textfile.txt would not overwrite filename of textfile.txt, but would append more text here to it. I hope this helps. Works perfectly.. Is it possible to add a paragraph of text rather than a single line? I realize that I'd have to put ECHO texttext >> text file.txt on each line, but are there parameters I can set for the entire blog? IE: ECHO "Multiple lines of text" >> "text file.txt" Thanks.. PatrickQuote from: pbisaillon on May 15, 2007, 01:48:54 PM Works perfectly.. Right. Quote but are there parameters I can set for the entire blog? Off the top of my head - no. Perhaps SOMEONE else will come along and post to confirm that. Are you working in 'dos' command line under WinXP? or real DOS? I ask because I'm reminded of something else - related, I suppose. Check out: http://home.mnet-online.de/horst.muc/wbat32.htm and look for ClipText 1.3 Could that be utilized in whatever job you are working on? If you had a ready prepared text file you could TYPE it to another text file. type file created on %date% at %time% > newtext.txt type C:\fixed\fixed-paragraph1.txt >> newtext.txt type c:\fixed\fixed-paragraph2.txt >> newtext.txt etc This the standard way of "echoing multiple lines of text" in a batch file and the only way I know of doing it without explicitly including them. pbisaillon: The type command completely slipped my mind. Try contrex's suggestion, and let us know if it does what you NEED. |
|
| 6483. |
Solve : HELP with batch FOR loop? |
|
Answer» Hello, I'm a week into learning batch files and I'm stuck on a few lines in a new file that I'm trying to write. the ordering of the filenames is always the same for the two list; here Quote Perhaps you also need to know that the variables %%s and %%l are of the form: I17CI and I17CI.site, respectively. The string slicing attempts with temps and templ make more sense if the former is the true case. Quote Ie: the variables don't get set! Can you tell me why? Variables in FOR statements are EVALUATED once: before the command is executed. Changes made to the variable aren't visible inside the command. You can use SETLOCAL and ENABLEDELAYEDEXPANSION and variables with ! instead of % to get around this. If you (a) examine (b) ponder and (c) run this code I'm sure you'll get the idea, and maybe if you incorporate elements of it in your code, you can progress a bit further, and we can see if your COPY OPERATION is performed OK. Code: [Select] @echo off REM put this at the start of your batch SETLOCAL ENABLEDELAYEDEXPANSION echo M13AZ> locations.txt echo G99QR>> locations.txt echo I17CI>> locations.txt echo QP44.site> sitefiles.txt echo FS15.site>> sitefiles.txt echo JM17.site>> sitefiles.txt for /f "delims==" %%l in (locations.txt) do ( for /f "delims==" %%d in (sitefiles.txt) do ( REM set environment variables REM as copies of FOR metavariables REM this is allowed in a loop set templ=%%l set temps=%%d REM but if you use them with percent signs REM they will seem empty REM and so an attempt to slice REM them will give empty results set percentnum1=%templ:~1,2% set percentnum2=%temps:~2,2% REM however this works REM using delayed expansion set exclamnum1=!templ:~1,2! set exclamnum2=!temps:~2,2! REM let's see the contents of the variables REM 2 and 4 will be blank as explained above echo 1 %%l %%d echo 2 %templ% %temps% echo 3 !templ! !temps! echo 4 %percentnum1% %percentnum2% echo 5 !exclamnum1! !exclamnum2! REM now for string comparison REM this works if !exclamnum1! == !exclamnum2! ( echo MATCH ) REM or your desired action REM if !exclamnum1! == !exclamnum2! ( REM copy "Path\file" "folder" REM ) REM However you can't do this, the batch crashes REM with the message 2! was unexpected at this time REM if !templ:~2,2! == !temps:~1,2! echo match echo. ) ) REM END OF CODE Here is the output:- Code: [Select]1 M13AZ QP44.site 2 3 M13AZ QP44.site 4 5 13 44 1 M13AZ FS15.site 2 3 M13AZ FS15.site 4 5 13 15 1 M13AZ JM17.site 2 3 M13AZ JM17.site 4 5 13 17 1 G99QR QP44.site 2 3 G99QR QP44.site 4 5 99 44 1 G99QR FS15.site 2 3 G99QR FS15.site 4 5 99 15 1 G99QR JM17.site 2 3 G99QR JM17.site 4 5 99 17 1 I17CI QP44.site 2 3 I17CI QP44.site 4 5 17 44 1 I17CI FS15.site 2 3 I17CI FS15.site 4 5 17 15 1 I17CI JM17.site 2 3 I17CI JM17.site 4 5 17 17 MATCH IT WORKS!!! |
|
| 6484. |
Solve : An all deleting thing..? |
|
Answer» Hey, i'm looking for something to delete every single file of a the "log" extension, in every PATH and on every HDD.. |
|
| 6485. |
Solve : Using MS-DOS and batch files to enable or disable the wireless card.? |
|
Answer» I can't SEEM to figure out what DOS command I can USE to enable or disable my wireless CARD in Windows XP. |
|
| 6486. |
Solve : How do I cancel / remove dos command Chkdsk C:/ f? |
|
Answer» I'm running Windows XP Professional SP2. I was doing some disk maintenance and stupidly issued the command "Chkdsk C:/ f" in the Command Prompt while in Windows. Now at startup, my system runs checkdisk but hangs up and doesn't finish. This occurs in every normal boot. Yes, it is NTFS, so my initial command was in error. Was it? That's news to me. Chkdsk /r and /f are both legal for NTFS. |
|
| 6487. |
Solve : HELP with running SSH from batch file? |
|
Answer» hello, |
|
| 6488. |
Solve : MS-DOS Text Manipulation Question? |
|
Answer» Hey all, (Is this a joke?)what do you think?Quote from: ghostdog74 on May 19, 2007, 02:59:35 AM Quote from: contrex on May 19, 2007, 02:14:21 AM(Is this a joke?)what do you think? You can never tell in this place Quote from: contrex on May 19, 2007, 03:01:40 AM Quote from: ghostdog74 on May 19, 2007, 02:59:35 AMwell..Quote from: contrex on May 19, 2007, 02:14:21 AM(Is this a joke?)what do you think? sample input: Code: [Select]C:\TEMP>more input This is a sample text file to show that using edlin is a joke. sample edlin command file: Code: [Select]C:\temp>more test.ed 1,#Ra joke<ctrl-Z>not a joke e output: Code: [Select]C:\temp>edlin input < test.ed End of input file *1,#Ra joke^Znot a joke 2: to show that using edlin is not a joke. *e final result: Code: [Select]C:\temp>more input This is a sample text file to show that using edlin is not a joke. I never intended to convey that the suggestion to use Edlin was a joke, in the sense that it wouldn't work. What I meant was that as someone who has been using PCs since 1981, I was so glad when better tools than Edlin came along! Edlin was created by Tim Paterson in two weeks in 1980, and was expected to have a six-month shelf life. Use of Microsoft's Edlin in today's environments is somewhat limited as it does not support long filenames. When attempting to describe Edlin's features, words like "crude" and "rudimentary" are often chosen. (Especially by me.) Quote from: contrex on May 19, 2007, 03:21:33 AM I never intended to convey that the suggestion to use Edlin was a joke, in the sense that it wouldn't work.glad to hear that. Quote What I meant was that as someone who has been using PCs since 1981, I was so glad when better tools than Edlin came along!edlin was just part of a myriad of tools that was available back then. sorry but i am curious , out of the box back then, can you suggest to me what better tools than edlin to do automated string manipulations like this? delete line number 10 to 15 for example? Quote Edlin in today's environments is somewhat limited as it does not support long filenames.so just keep it short? FWIW, this should not be the reason for not using it when the need arises. Quote When attempting to describe Edlin's features, words like "crude" and "rudimentary" are often chosen. (Especially by me.)well, batch is "crude"/"rudimentary" to me too if i am comparing against better tools to do the task at hand. however, if i just want to move/copy files, i can quickly write in batch. its quick and fast. Its the same when i decided to use edlin. |
|
| 6489. |
Solve : Fun with dos..... help!? |
|
Answer» Nice to see you back, Lordoftheplat. lol how many people have been tryingSee, pranks are fun.....harmless pranks...... I have 20mb of joke programs on my memory stick that do things like shake the screen or invert the colors of the screen. So funny You'd need to go to the hospital if you ever tried them on mine, dudeoxide. Wow, you actually spared my LIFE. I thought you would just kill me off right there Of course the joke programs aren't permanent (sadly)Actually, when I worked in an electronics factory, we used to scrape the polarity marking (a red blob) off electrolytic capacitors and re apply on the OPPOSITE side with a red INDELIBLE marker and place them in other peoples component stocks. They'd get assembled onto boards and when circuit testing time came, they'd explode. COULD have blinded someone, but hey... i like the exploding part...but not the blinding part... Gotta wear shades --> Quote from: contrex on May 19, 2007, 09:24:47 AM Actually, when I worked in an electronics factory, we used to scrape the polarity marking (a red blob) off electrolytic capacitors and re apply on the opposite side with a red indelible marker and place them in other peoples component stocks. They'd get assembled onto boards and when circuit testing time came, they'd explode. Could have blinded someone, but hey... Much less harmful than opening someone's CD Tray...see why we don't do it ? ? |
|
| 6490. |
Solve : CD command? |
|
Answer» he can use that to cd to his previous location.Quote from: WillyW on May 19, 2007, 09:36:59 AM Quote from: contrex on May 19, 2007, 09:31:25 AMQuote from: WillyW on May 19, 2007, 09:26:50 AM Maybe English is not your first language? I meant, "What is the reason why you have put a period after the echo command?", not "What does a period do after an echo command?" Lol, what does it matter. I find it easier for me to use 'echo. text' than 'echo text' You dont have to use the period for %cd:~20,0% but i did coz i could......Quote from: Carbon Dudeoxide on May 19, 2007, 09:38:24 AM he can use that to cd to his previous location. Oh right. So I'm in D:\My Folders\*censored*\Mom don't look in here\Babes\Redheads and I type CD d:\ So now I'm in d:\ I type your command and it cuts the last 20 characters off the directory name, which is actually 3 characters long, so I end up with an empty string, which ECHO interprets as a request to SHOW ECHO status, so it SAYS "ECHO is on", and that GETS me back to my previous folder? Is that how it works? That's a real clever DOS tip, dudeoxide! i WOULD nevah have thunk of that all on my lonesome! well then you change 20 to a number that suits you.It's only useful if "where you were before" is a parent folder of where you are now. typing cd.. (enter) and then repeatedly recalling it with the up arrow would do the same thing. Reinaker: You can use PUSHD and POPD. For example, if you start off in Contrex's directory of D:\My Folders\*censored*\Mom And you want to go to the directory D:\Foo, you could use the command Code: [Select]pushd \FooThen to get back to the previous directory do Code: [Select]popdOr if you wanted to go to C:\Documents and Settings you could use the command Code: [Select]pushd "C:\Documents and Settings"Then to get back to the previous directory do Code: [Select]popd Another tip ... if you are writing a batch file that changes directories and it ends up leaving you in a directory used by the batch file instead of the original, you can use the SETLOCAL command. Example: Code: [Select]@echo off setlocal cd \Temp ren *.new *.oldIn this example the batch file would leave you in whatever directory you started in. Without the SETLOCAL command, the batch file would leave you in \Temp. |
|
| 6491. |
Solve : (solved)defragmentation at startup.(Pause for x many seconds?)? |
|
Answer» Here is the newer vesion: I also think that if it is going to work, you would need to remove any prompts for the user, as there will not be a console to display any output.How do I have to do this? I tryed it but I can't find any process My program is called "boot defragmentation.bat" but the only process I can find is "defrag.exe". (edit) Jonas The code you have should be fine the way it is written. Using the code you posted, you have already removed all prompts for the user. The process you would have to end would be one or more of: defrag.exe dfrgntfs.exe dfrgfat.exe And you may have to end them as many as 4 times (once for each drive letter). Or better yet, let them run until they finish, or run the defrag command manually.OK thanks for all the help I really appreciate it. Now it works fine. Jonas |
|
| 6492. |
Solve : Batch file problem? |
|
Answer» I have a problem whenever i try to make BATCH file and GIVE him exit cammand it did not work any one can help me i try it on windows 2003 and windows xp or any one can make it for me or in an other program i am USING arp -s .... command Please help me |
|
| 6493. |
Solve : chang name of START button? |
|
Answer» hi I'm just trying to figure out why you would want to do this. I couldn't either, but it certainly is one of the more IMAGINATIVE ways to turn a PC into a brick. And sometimes that is a good thing. |
|
| 6494. |
Solve : Fdisk and Skandisk? |
|
Answer» Fdisk error MESSAGE is No fixed disk preasent. But when I run scan disk it says no errors on Drive. What does that mean? Is it possible for SCANDISK to work when Fdisk says no fixed disk preasent? |
|
| 6495. |
Solve : Boot disk commands? |
|
Answer» Can someone give me some pointers on MODIFYING a BOOT disk to launch a batch file automatically? I have a lot of COMPUTERS that I routinely format with aefdisk and I'd like to just be able to just put in my boot disk and not type in anything. I have a batch file on the disk that has my commands but I'm not sure how to set it up as either a menu (just in case) or have it just run the batch file after the system boots up. Any suggestions WOULD be great. |
|
| 6496. |
Solve : Get a substring from the file? |
|
Answer» I have one file 'filename.txt' which have contents like set var='SHCS112.txt' Where did the SINGLE quotes come from? Although they would not prevent the batch file from functioning properly there is no mention of them in the original post. It should be echo !var! due to the delayed expansion 8-)Hi, This is my screen shot of my command window. ------------------------------------------------------------------------ C:\>setlocal enabledelayedexpansion C:\>set var=SHCS112.txt C:\>set var=!var:~2,2! C:\>echo !var! !var! ------------------------------------------------------------------------- My result is !var! Please help me in solving this as I am new to WRITING Batch Script. Cut and Paste this code into your favorite editor (notepad works just fine): Code: [Select]@echo off setlocal enabledelayedexpansion for /f %%i in (filename.txt) do ( set var=%%i set var=!var:~2,2! if !var!==CS echo %%i >> cs_files.txt if !var!==CQ echo %%i >> cq_files.txt ) Save the file with any name you choose but be sure to give it a .bat EXTENSION. You can then run the file you SAVED from the command line. 8-)Hi, Thanks a lot for guiding me. Its really awesome. I got the exact result. This is really a wonderful site which makes me do the task easily. Thanks a lot! Thanks a lot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
| 6497. |
Solve : batch files in XP?? |
|
Answer» Hi everyone...I was just trying to make a batch file to delete cookies from a system. I was forgetting that in XP the cookies are in the user directory and I'm having trouble figuring out what to do with this LINE. |
|
| 6498. |
Solve : check if CD Rom is enabled or disabled? |
|
Answer» HI... I would LIKE to know if there is a way in which one can through a batch file find out : 1. if the CD ROM is enabled or disabled 2. If any of the USB ports are being used and if yes what are the peripherals they are attached to? Please can someone help me out?Question 1: This code checks if the driveletter in variable %CDROM% exists. (If a CD is in the drive or not.) I don't think it is possible to check the device with batch in the windows world. The solution is a bit unfortunate. hope it helps uli snip ---------- set CDROM=d for %%x in (%CDROM%) do ( if exist %%x:\NUL (echo CDROM - Drive is active %%x: ) else (echo CDROM- Drive is not active) ) set CDROM= ---------- snapHi, You can check for removable drives with fsutil fsinfo drivetype. I.e. if the drive you want to check is D:\ then use: fsutil fsinfo drivetype D:\ It might return: D:\ - Removable Drive D:\ - Fixed Drive D:\ - Network Drive D:\ - CD-ROM Drive D:\ - RAM Disk Drive or D:\ - No such Root Directory Or check all drives with a loop as described here: http://www.dostips.com/DtCodeSnippets.php#_Toc141112837 USB drives would show up as "Removable Drive" I guess, just like Floppy Drives. All this is not exactly what you are asking for but hope it still helps you in the one or other way. Thanks a lot guys it helped me a lot |
|
| 6499. |
Solve : batch file will not run from windows? |
|
Answer» My batch file will run fine if executed from the command prompt, but goes nowhere if executed from windows (start/run or DOUBLE click in windows exploror). When started from Windows it simply starts DOS and stops. Any help?POST your coding please...an example of batch file, display-dir.bat, that stalls: |
|
| 6500. |
Solve : Birthday? |
|
Answer» I want to make a program that remembers your birthday. In a extern file are the dates; for instance LIKE : Miki 07/06 . If you type in the program the date 07/06, i want the program to show : on 07/06, its miki's birthday Microsoft has a habit of adding features to batch language with each new release of Windows. Without knowing your OS, it's difficult to write a script that will run on your machine. It's windows xp, I found out by looking at his last posts, it's mentioned there Thank you for that BlackBerry. Actually I was trying to hint to the poster to be more forthcoming with information that is not a state secret. Unless this a CONTINUING REQUEST spread over multiple threads, I'm just not sure it should be necessary to research information from past posts in order to respond to the current post. 8-) Quote Thank you for that BlackBerry. Actually I was trying to hint to the poster to be more forthcoming with information that is not a state secret. Unless this a continuing request spread over multiple threads, I'm just not sure it should be necessary to research information from past posts in order to respond to the current post. I think it is up to the poster to make his information known, rather than our RESPONSIBILITY to ferret it out. After all, it is HIS problem. Right, but clicking on the recent post button costed me a few second and after all, beeing nice is never wrong Quote I'm just not sure it should be necessary to research information from past posts in order to respond to the current post. I agree, it's not our job to do it, so I think from now one I will let them say it |
|