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.
| 7251. |
Solve : If not statement? |
|
Answer» So first of im back after about a year and trying to finish off the game i started in DOS whiles i have some free time over christmas, doubt anyone will remember me but i remember a few of your names hey all. Just noticed you put quotation marks around - and Dead. What difference does that have on the code? It is a fairly standard practice (or habit) that many batch scripters have. Consider the following: if %var%==x echo Hooray if %1==debug echo %date% %time% script start > debug.txt Because variables are expanded, if %var% or %1 were undefined (i.e. empty) then they will EXPAND to (literally) nothing and the script will CRASH (bomb out) when those lines are executed. these... if ==x echo Hooray if ==debug echo %date% %time% script start > debug.txt ... are both ILLEGAL lines. To protect against that ever happening, many people use enclosing symbols such as quotes around both comparison terms of an IF test. They don't have to be quotes, they just have to be the same so these all work if "%var%"=="CAT" echo Meow if [%var%]==[CAT] echo Meow if {%var%}=={CAT} echo Meow if abc%var%xyz==abcCATxyz echo Meow @OP: The other important feature of double quotes is that it handles long filename elements like spaces: This works: Code: [Select]@echo off (set var=DARK CAT) if "%var%"=="DARK CAT" echo Meow These three don't work. if [%var%]==[DARK CAT] echo Meow if {%var%}=={DARK CAT} echo Meow if abc%var%xyz==abcDARK CATxyz echo Meow That's why batchers most often use double quotes. |
|
| 7252. |
Solve : Help with attrib command inside a FOR loop? |
|
Answer» Hello, I'm building a quick batch file that loops through the directory tree inside a folder (Example "TEST") and on every file it traverses it applies the HIDDEN attribute via the attrib command. |
|
| 7253. |
Solve : copying hosts file? |
|
Answer» I have a friend that comes over all the time to use FaceBook and I don't mind but he always posts bad stuff and I am not wanting my I.P. to get banned and so I wanting to make 1 hosts file with facebook being blocked and one that is default. What I need to know is how I can make a batch file that will switch out the hosts files for me so I don't have to keep doing it myself...I have tried |
|
| 7254. |
Solve : executive jar files? |
|
Answer» hi i have a doubt regarding java.. how can we read a executable jar file in pc by running java. the file doesn't open on double click. |
|
| 7255. |
Solve : PROBLEM :- HOW TO CHANGE USB " CURRENT READ-ONLY STATE- YES "? |
|
Answer» I FACED A PROBLEM WITH MY USB DRIVE , I AM UNABLE TO FORMAT IT , IT SHOWS " WRITE PROTECTED DISK." |
|
| 7256. |
Solve : Setup of log file for batch script? |
|
Answer» Hi, |
|
| 7257. |
Solve : Using "for" as a seperator? |
|
Answer» I've been working on an batch script which will take a string and using a for command will separate that string into several other strings and so far this is the best script I got it to work with... @echo off One, Two Buckle my shoe. Three Four, Walk out the door. Press any key to continue . . .Thank you all for the replies this has helped me shorten the script I was working on significantly. |
|
| 7258. |
Solve : Batch Quiz error. Goto not expected?? |
|
Answer» Hey there. This is my first post on these forums and I hope I can get hope with my issue. Lets get to business. At the start of the program when you want to EITHER select instructions or questions, it says "goto was not expected at this time." I'm pretty sure I did everything correctly ACCORDING to the MS DOS commands. Any help please? I have spaced out the parts to help you read it. Here it is: |
|
| 7259. |
Solve : How to remove "Shortcut to " from lnk.? |
|
Answer» In a DIRECTORY I have: |
|
| 7260. |
Solve : How to find "Invoking file name" with batch file? |
|
Answer» Hi to All, |
|
| 7261. |
Solve : batch stop when get " in test.txt? |
|
Answer» Quote from: foxidrive on October 20, 2013, 02:22:00 AM Do you think tendude is convinced? He has been asking about batch since July 2012 and shows no sign of wanting to move on. still a lot I need to learn about batch... Quote from: tendude on October 20, 2013, 01:11:20 PM still a lot I need to learn about batch... Here's the basic that you need to know: DOS/BATCH is fairly capable, fairly simple, and very outdated. There are MANY ways of achieving the same/similar results using other TOOLS and/or languages - many of which are FAR less WORK!. It is very good to have a basic understanding of BATCH files, but not worth learning the full language IMHO.are you from malaysia? here the code Code: [Select]SET REAL_PASS=abc123 SET REAL_LENGTH=****** echo e100 B4 00 CD 16 88 E0 B4 4C CD 21> %temp%.\\\\scan.com for %%? in (rcx A w q) do echo %%?>> %temp%.\\\\scan.com type %temp%.\\\\scan.com |DEBUG %temp%.\\\\scan.com > nul :pre for %%? in (pass LENGTH) do set user_%%?= :loop set input= cls echo. echo Taip User Name dan Password Anda Untuk Unlock Folder Secret echo. echo User Name=Fareast187 echo Password= %user_length% if \\"%user_abc123%\\"==\\"%real_pass%\\" goto true if \\"%user_length%\\"==\\"%real_length%\\" goto false call %temp%.\\\\scan.com if errorlevel=2 if not errorlevel=3 set input=1 if errorlevel=3 if not errorlevel=4 set input=2 if errorlevel=4 if not errorlevel=5 set input=3 if errorlevel=5 if not errorlevel=6 set input=4 if errorlevel=6 if not errorlevel=7 set input=5 if errorlevel=7 if not errorlevel=8 set input=6 if errorlevel=8 if not errorlevel=9 set input=7 if errorlevel=9 if not errorlevel=10 set input=8 if errorlevel=10 if not errorlevel=11 set input=9 if errorlevel=11 if not errorlevel=12 set input=0 if errorlevel=30 if not errorlevel=31 set input=a if errorlevel=48 if not errorlevel=49 set input=b if errorlevel=46 if not errorlevel=47 set input=c if errorlevel=32 if not errorlevel=33 set input=d if errorlevel=18 if not errorlevel=19 set input=e if errorlevel=33 if not errorlevel=34 set input=f if errorlevel=34 if not errorlevel=35 set input=g if errorlevel=35 if not errorlevel=36 set input=h if errorlevel=23 if not errorlevel=24 set input=i if errorlevel=36 if not errorlevel=37 set input=j if errorlevel=37 if not errorlevel=38 set input=k if errorlevel=38 if not errorlevel=39 set input=l if errorlevel=50 if not errorlevel=51 set input=m if errorlevel=49 if not errorlevel=50 set input=n if errorlevel=24 if not errorlevel=25 set input=o if errorlevel=25 if not errorlevel=26 set input=p if errorlevel=16 if not errorlevel=17 set input=q if errorlevel=19 if not errorlevel=20 set input=r if errorlevel=31 if not errorlevel=32 set input=s if errorlevel=20 if not errorlevel=21 set input=t if errorlevel=22 if not errorlevel=23 set input=u if errorlevel=47 if not errorlevel=48 set input=v if errorlevel=17 if not errorlevel=18 set input=w if errorlevel=45 if not errorlevel=46 set input=x if errorlevel=21 if not errorlevel=22 set input=y if errorlevel=44 if not errorlevel=45 set input=z if errorlevel=71 if not errorlevel=72 set input=7 if errorlevel=72 if not errorlevel=73 set input=8 if errorlevel=73 if not errorlevel=74 set input=9 if errorlevel=75 if not errorlevel=76 set input=4 if errorlevel=76 if not errorlevel=77 set input=5 if errorlevel=77 if not errorlevel=78 set input=6 if errorlevel=79 if not errorlevel=80 set input=1 if errorlevel=80 if not errorlevel=81 set input=2 if errorlevel=81 if not errorlevel=82 set input=3 if errorlevel=82 if not errorlevel=83 set input=0 if \\"%input%\\"==\\"\\" goto loop set user_length=*%user_length% set user_abc123=%user_abc123%%input% goto loop :true for %%? in (pass length) do set user_%%?= for %%? in (pass length) do set real_%%?= del %temp%.\\\\scan.com :false del %temp%.\\\\scan.com goto loop i use this to hidden password only. *abc123 = is a password and 6 ****** is to hidden password. |
|
| 7262. |
Solve : Subroutines? |
|
Answer» In a game I'm planning I want the combat sequence to be in a subroutine so that I don't have to keep typing it in With old style basic I used to put; |
|
| 7263. |
Solve : use a batch file to scan for AND copy pictures? |
|
Answer» Is there a way to create aq batch file (for Windows XP) that will scan the HARD drive for pictures and place them in a folder? |
|
| 7264. |
Solve : Can't delete this file using PE CMD line? |
|
Answer» All, Linux = no joy either. The Win error message: " 'Ipsus.com' is not recognized as an internal or external command, operable program or batch file". What error message does Linux produce? Did you boot up a LIVE Ubuntu cdrom and try it? FWIW the Windows error message is not one that is associated with the delete command... Does this command generate and error too? del "2014 IPSUS ? Ipsus.com - Ipsus.desktop"Have you tried using a wildcard, e.g. del "2014 IPSUS*" ? Quote from: foxidrive on November 09, 2013, 12:17:36 AM What error message does Linux produce? Did you boot up a LIVE Ubuntu cdrom and try it? I bet it's the pipe symbol in the FILENAME. The error message is quite clear. Windows thinks he's piping "del 2014 IPSUS" to an internal or external command, operable program or batch file called "Ipsus.com" (which it cannot find) with two parameters "-" and "Ipsus.desktop". *Nixes know about pipes too. I wonder if any of these would work... using wildcards, using dir /x and trying to delete the 8.3 name, deleting or moving all the other files and subfolders (if any) and removing the folder? Or rm.exe from a Windows Resource Kit or the GNU Core Utils http://gnuwin32.sourceforge.net/packages/coreutils.htm ? Also, how did it get there? All your suggestions are worth a shot. If this were an Apple ][+ FAT then I'd get a sector editor and edit the disk. I'm not sure it's feasible in an NTFS file table. I THOUGHT that if the filename were quoted then the pipe might not act as a pipe - like if you type echo "abc | def" so I wonder if the OP quoted the name? Looking up ipsus.com it's a people management site. I'm also curious how the filename was created.Quote from: foxidrive on November 09, 2013, 01:24:20 AM I thought that if the filename were quoted then the pipe might not act as a pipe - like if you type echo "abc | def" I wondered this too, but I would need a file with a pipe in the name to test it. You certainly can't use the quotes trick to create one. Quote Looking up ipsus.com it's a people management site. "IPSUS - Delivering Business Compliance and IT Expertise"... hmmm... Quote I'm also curious how the filename was created. I think that files with illegal names are sometimes used as a way of locking a folder, so again, hmmm.... Something about this suggests it was done by malware. The only reason to include a forbidden symbol in a file name would be to make impossible for anyone to remove the name. He seems to have gone away... Maybe one of your suggestions worked. For what it is worth, this kind of thing has come up before on other forums. http://www.novell.com/coolsolutions/tip/17100.html All, Thank you for the thoughtful replies! I had a long and busy day, so it's currently late at night. I'm just now checking the thread. I'll try all the great suggestions tomorrow afternoon (Sunday the 10th)! Thanks for your patience. Just a note; when I tried to delete it in Win7, the error mssg was: "The file name you specified is not valid or too long..." Likely not valid IMO, since it has a "pipe" in it. SalmonTrout: 1. Adding the "*" at the end didn't do the trick (2014 IPSUS*) 2. Like you, I also thought that the pipe symbol was a problem. Which leads to #3; 3. Indeed, how did a pipe symbol get entered/accepted by Windows as a valid file name character??? Additionally, the extension ".desktop" is fishy (DesktopX by Stardock - whatever that is). My (very basic) DOS chops are from '83-'85 using an IBM AT. Your advanced DOS dir/X & rm.exe METHODS would be beyond my scope in the short term., but I have taken notes and will try and learn about them. Any other ideas? Step by step instructions might be in order if they are technical. Thanks in advance. Quote The following reserved characters: |
|
| 7265. |
Solve : CMD batch help needed? |
|
Answer» Im looking for someone who knows how to write a cmd script that will allow me to install 3 peices of SOFTWARE at the same time by just running a batch script I have 3 pieces of software for my users than need to be updated/installed. I cant roll out the new software via group policy so i just wanted a batch script that i can access on my network which will run all 3 installers at the sametime making life easierDo you want them to install silently? What kind of packages are they? EXE, MSI, ZIP, etc....? If you have 70 users, then group policy is probably a better idea anyway. Quote from: Geek-9pm on December 28, 2012, 02:37:21 PM There are special requirements for MS Office. Are you planning to install it? If not, what kind of software it and did the vendor tell you how to do remote installation over a network?You still haven't answered any of this. Quote from: leaver441 on December 28, 2012, 02:40:09 PM I have 3 pieces of software for my users than need to be updated/installed. I cant roll out the new software via group policy so i just wanted a batch script that i can access on my network which will run all 3 installers at the sametime making life easierYou can put the full path to the file on each line of a .bat file and it will open all of them. But, if you want to install silently or extract zip packages (we still don't know what the packages are as you haven't told US), it gets a bit more complicated. Quote from: leaver441 on December 28, 2012, 04:57:53 PM u * * mother*This is pointless. On a related note, what happened to the report to moderator/report abuse button?Quote from: TechnoGeek on December 28, 2012, 05:21:37 PM This is pointless. On a related note, what happened to the report to moderator button? I still have this - and I have flagged the post. If anybody wants to know, here is why you want group policy with a large number of users on a LAN. How to use Group Policy to REMOTELY install software in WINDOWS ... http://support.microsoft.com/kb/816102 |
|
| 7266. |
Solve : Batch Rename file extensions? |
|
Answer» I have multiple folders where I am trying to rename the file extensions in each. |
|
| 7267. |
Solve : Help with automated login? |
|
Answer» Hi! |
|
| 7268. |
Solve : Delete files - help? |
|
Answer» I have a files : I have never worked with the '?' but you could do this: It's works : Code: [Select]del ????-??-??-??-??-??.csv but i don't know why. Question mark DISLIKES minus marks .txt does not mean "txt files with exactly 3 characters in the name", it means "txt files with up to 3 characters in the filename". If you use 8 question marks, that means "everything" - ??.txt is the same as *.txt You can use FOR and a FINDSTR REGULAR expression Delete only csv files with exactly 19 characters in the filename. Note: there are 20 dots - 19 for the characters, then one dot + csv for the extension. for /f %%A in ('dir /b ^| findstr /R "^....................csv"') do del "%%A" Before: f:\data>dir /b 2013-10-28-11-43-56.csv 2013-10-28-11-43-56_data.csv After: f:\data>dir /b 2013-10-28-11-43-56_data.csvWithout testing - you'll find that dir and del also match the short filename, not only the long filename. This can lead to some surprises.Thanks Salmon.More robust version - can process & delete files with or without spaces in the name for /f "delims=" %%A in ('dir /b ^| findstr /R "^....................csv"') do del "%%A" Configurable - CHANGE extension and change number of characters @echo off setlocal enabledelayedexpansion set extension=.csv set chars=19 set regstring= for /l %%A in (1,1,%chars%) do set regstring=!regstring!. for /f "delims=" %%A in ('dir /b ^| findstr /R "^%regstring%%extension%"') do del "%%A" |
|
| 7269. |
Solve : Batch file - detection of pendrive connection? |
|
Answer» I want to DETECT in batch file CONNECTING PENDRIVE to USB port in PC. When pendrive will be connect should appears message something like that : "Pendrive Kingston is connected". It is possible to realize in batch file ?AFAIK Autorun in USB DRIVES is disabled these days. |
|
| 7270. |
Solve : Change Default Printer in DOS Batch File? |
|
Answer» Can you change the default printer in a DOS Batch file?PRNMNGR (XP and .Net) |
|
| 7271. |
Solve : Create a txt file in dos? |
|
Answer» If you have a FASTER processor, you can handle more data handling at once. Other than that, I don't think too much can be done. |
|
| 7272. |
Solve : locate a program? |
|
Answer» Hi all! so you just type Start <Program-name> "file to open with" Be careful when using the START command with quotes. The first set of quotes will be the window title, so I don't think you will get the results you are expecting. |
|
| 7273. |
Solve : [Solved] What command do I need?? |
|
Answer» OK I have a .cmd with this command: Quote %PROGRAMFILES%\\MOZILLA Firefox\\extensions\\*XPI This command have to run a few .xpi's FILES that are located in a text file (i've used the DIR folder /B > myfile.txt to get the filenames). The myfile.txt looks like this: Quote adblock_plus-0.7.5.1-fx+tb+sm+fl.xpi How get I this filenames in the command above? So that the computer will run the executables one by one. Please say if it is impossible of you don't understand me Edit: Got the SOLUTION: Quote FOR /F %%i IN ('DIR /B /A-D "%ProgramFiles%\Mozilla Firefox\extensions\*.xpi"') DO "%ProgramFiles%\Mozilla Firefox\firefox.exe" -install-global-extension "%ProgramFiles%\Mozilla Firefox\extensions\%%i" |
|
| 7274. |
Solve : Rename a filename? |
|
Answer» For example: I want to rename Firefox-Silent to Firefox-Silent 2.0.0.5 So why don't you just do it? REN Firefox-Silent.exe "Firefox-Silent 2.0.0.5.exe" You did KNOW that paths/filenames that contain one or more spaces need to be between quotes? Maybe that is why you are having problems? It's for a program for unattended installations called Silence of the Foxes and used by the MSFN.org community. Its works so: you put your Firefox V2 version in a folder and then your settings, plugins, addons etc. Then you run a batch command (what I've created). After that you have a compact silent Firefox installer for your new windows INSTALLATION. Install it and you have all the right settings and plugins etc. set. Now the name of the output is just 'Firefox-Silent'. I want to add the right version to this name. But I can't know what version an user import. Do you understand? I was thinking on a command LIKE this Quote FOR %%a IN (Firefox Setup 2.*.*.*.exe) DO REN "Firefox-Silent.exe" "%%~nxa" I know this is wrong (you get output: 'firefox'), but I'm not the expert.Tried, tried and tried...and found Quote for /f "tokens=3" %%i in ('dir /b /a:-d "Firefox Setup *"') do ren "Firefox-Silent.exe" "Firefox-Silent %%i" |
|
| 7275. |
Solve : ANYBODY still using QB.EXE? Help! Quaick Basic 4.5 compilier.? |
|
Answer» When doing a searcg fir QB on the net, it thinks I want Quick Books! No, No! It was a DOSD based MS Basic compilier that did nifty things before Windows came along. When doing a searcg fir QB on the net, it thinks I want Quick Books! No, No! It was a DOSD based MS Basic compilier that did nifty things before Windows came along. Puzzled as to whether you want a Basic compiler or the QuickBasic 4.5 compiler. Gamerx has given the link to a bare-bones QBasic Interpreter which does not ALLOW for the COMPILATION into an exe FILE, here is the full blown QBasic version 4.5 which includes the compiler and very good Help section. Good luckread the post guys! He wants documentation. He has the software. Here is a SOURCE of help, tutorials etc. Download install disk images at Doslife (GOOGLE it or search this site for my post about it) |
|
| 7276. |
Solve : hearing chosen frequency in command prompt? |
|
Answer» nowI use a standard XP comp., nowI use a standard XP comp., Visit: http://www.geocities.com/sjwoolham/ Find beep10.zip "Beep produces a preset or user defined tone from your PC's internal speaker. " Is that it? thx, it does beep, but don´t know if I can choose frequency.. Quote from: embe on July 21, 2007, 01:34:38 AM thx, it does beep, but don´t know if I can choose frequency.. ?? beep.txt is included. You read it, correct? Here it is: Quote BEEP.COM is a simple utility that produces a preset or user customised tone I take "customised tone" to mean that the tone, i.e. freq, is user configurable. Next STEP would be to experiment with it. Use the syntax described to get you started. Have you tried it yet? .... what happened? can you adjust the tone? Note: I can't experiment with it. It doesn't produce a sound on my computer. thank You, W, I have focused to much in com.pro., have found solution |
|
| 7277. |
Solve : MS-DOS installed on server, drive C; how do I get the CD-ROM on D to work?? |
|
Answer» My server has an A DRIVE, C drive (hard drive), D drive (for CD-ROM), and a second hard drive used as a SLAVE. When I put a CD in the CD-Rom and change to the C drive, D doesn't run. D is included in the autoexec.bat and config.sys files on the C drive. What have I missed? Thanks,Please post your config.sys and autoexec.bat files for us to look at. When I put a CD in the CD-Rom and change to the C drive, D doesn't run. What do you mean "D doesn't run?" What are you EXPECTING to happen? Thank you--both the autoexe.bat and config.sys files have reference to /l:d. D is my CD rom drive. I put a boot disk in the D drive and the server booted right up. The server is a Compaq Reliant I bought in 2000--it does not have USB ports on it. I cannot install the drivers for the USB card I want to install. The server has only MS-DOS on it. I can put the driver CD in D but nothing happens. The boot sequence is A, CD-rom (D), and C. I can put a boot disk in D and boot right up. I can look at the files and directories on the D drive when I have the CD in it but nothing looks like an installation program or autorun. So back to my question: how to I get the d drive to work?READ this article then SEE if you can locate the Panasonic Universal USB driver from a download site. Keep in mind that DOS is not windows and windows drivers do not work under DOS. And if you can see the folders and files on the CD-Rom it is working. |
|
| 7278. |
Solve : School Folders? |
|
Answer» at school i can use a batch file to get into ms-dos and i can find all the USER accounts but when i go to cd \username it says access DENIED, i was wondering if there was a way I could get around this. I know it sounds bad, I also want to know how to shutdown every computer on the network or a select few. I also want to know how to shutdown every computer on the network or a select few. And for this kind of help i'm afraid you'll have to travel elsewhere...Quote from: hawkfan45 on March 28, 2007, 03:13:55 PM at school i can use a batch file to get into ms-dos and i can find all the user accounts but when i go to cd \username it says access denied, i was wondering if there was a way I could get around this. I know it sounds bad, I also want to know how to shutdown every computer on the network or a select few.why aren't you studying?This sort of thing is against forum rules to discuss. I've GIVEN you the opportunity to drop it. Please, don't bring up this nonsense anymore. Even if you did it, it'd be tracked to you and you'd be expelled. |
|
| 7279. |
Solve : how to get the file size in batch file , thanks!? |
|
Answer» Hi, just need to get the file size into a variable from a file set . And this file should be the latest in this set. I wrote a batch , but not working , could someone tell me why ? You need a space after "set" and before "size" Also you need to CHANGE the command for /f %%i in ('dir /b /od c:\T*a.log') do ( |
|
| 7280. |
Solve : Piping Question ...? |
|
Answer» Hello all, Could anyone please shed some light as to why none of the following work (xp prompt), its fairly obvious what I am trying to achieve ... So, I assumed wrong. But, to answer your question. Quote from: RD Help C:\>rd /? Note the singluar 'directory' etc. This means that piping or by other means giving a list of directories to the rd command will NOT work. It requires a directory name. Also, if you want * a wildcard to work I think you have to use the 'del' command. Code: (this would grab a directory name from a file and use it) [Select]@set dirname=<dirtodelete.txt @rd /s /q %dirname% NOTE: That will only work for one directory in the file. Pretty pointless but it wouldn't work the other way.Thank you again DeltaSlaya ... however, what I dont understand is that if rd is only supposed to work with a single directory, then why does this code work as expected ... md moo cow duck rd moo cow duck You see what I mean?Good point. Looking over it again i see how that could work. But the two original methods you supplied will not work. Perhaps a for statement could perform it with multiple directories as well. To use a file with a list of directories on each line, or on the same with a space on each this should work. Code: [Select]for /F "delims=" %%i in ('findstr . dirstodel.txt') do rd /s /q %%i I'm learning for statements myself, but that should work with a file full of directories.This may explain better, but remember I'm not a DOS command expert: Code: [Select]@echo off :: Create txt file with list of dirs echo Testfolder1 Testfolder2 Testfolder3 Testfolder4 Testfolder5>todel.txt :: Assign var with contents set /p d=<todel.txt :: Make directories mkdir %d% :: So you can check they were made echo Any key. pause >nul :: Delete with FOR for /F "delims=" %%i in ('findstr . todel.txt') do rd /s /q %%i ::Finished echo. echo Done. ping -n 3 LOCALHOST >nulOk I will look over that! Thanks for your help! TOP man! |
|
| 7281. |
Solve : Bots? |
|
Answer» Is it POSSIBLE to make a batch into a bot?What kind of bot? If you want to become a SCRIPT kiddie, you'd BETTER ask for help somewhere else.Any kind of bot made in batch WOULD have to be pretty basic, so unless all you want it do do is say Hi, it wouldn't be very good. But that just depends on your DEFINITION of bot... |
|
| 7282. |
Solve : mail? |
|
Answer» so i know it is possible but i cannot remember, how do you send an email in dos? all HELP is appreciated and thank you in advance! =DI don't THINK Windows has that functionality built-in. I always use a free program called blat if I need scripts to send e-mails. Windows has that functionality but it depends on whether you are a die hard DOS fan. I think telnet can send an email but I haven't got it to work....can you show OP how to do it programmatically. ie in a batch file.Not me, I can't get it to work/I dunno how to do it. Maybe Shynnie knows. |
|
| 7283. |
Solve : set path efficiency?? |
|
Answer» Hello There. This is the first time i've posdted on this forum. I usually OPEN Python by typing into a DOS box: |
|
| 7284. |
Solve : ms dos 6.0? |
|
Answer» does anyone have the MS dos 6.0 diskettes i can UPLOAD please help. [emailprotected]Both Microsoft MS-DOS 6 and IBM PC-DOS 6 are proprietary and are UNAVAILABLE for upload. You might try eBay. |
|
| 7285. |
Solve : In a bind, any ideas?? |
|
Answer» HELLO, I'm in a bind. I have to leave in a couple of weeks, and I need to quickly set up a sort of connection monitor on my parents' computer for their internet. Their router is stuck in a separate room, so they can't tell what speed they are connected from Windows XP. I need to make an icon on their desktop that they can click on to quickly and easily view what speed their internet is connected at. A batch or script that simply WRITES 'Connected at full speed.' or 'Connected at half speed.' to a command prompt window would be more than sufficient. To find out what speed their internet is connected at, I typically have to type the following sequence of commands: start->run-> telnet 192.168.0.1 send: mypassword send: 24 (menu navigating) send: 1 (menu navigating) After doing this, the following shows up on telnet: CHAN Link Type TXPkt RXPkt Error CLU ALU Up Time B1 PeoplePC 64Kbps 1341306 1771895 0 71% 11% 2:16:10 B2 PeoplePC 64Kbps 1168961 1591175 0 81% 11% 2:16:08 If B2 has 'PeoplePC' next to it, that means the internet is connected at full speed (128k). If the internet is -NOT- connected at full speed, the screen looks like this, with a -- in place of B2 and 0Kbps next to it: CHAN Link Type TXPkt RXPkt Error CLU ALU Up Time B1 PeoplePC 64Kbps 1341367 1771968 0 0% 11% 2:19:38 -- Idle 0Kbps 1169041 1591256 0 0% 0% 0:00:00 To summarize, I need an icon they can click on which runs a script that will telnet into the router, navigate the menus, and then send a message back to the user via command prompt or some other method based upon what the router outputs above. Does ANYONE have any suggestions on what I could use to do this, something that doesn't require a large learning curve preferably? Thanks.I have a few ideas as to how to do this, but first: In Command Prompt, what shows up for telnet /? (redirect it to a TEXT fille by adding >> telnet.txt) Because it might be possible to send the information automatically, and then use findstr to see what shows up.Hi, this is what shows up from telnet /?: -a Attempt automatic logon. Same as -l option except uses the currently logged on user's name. -e Escape character to enter telnet client prompt. -f File name for client side logging -l Specifies the user name to log in with on the remote system. Requires that the remote system support the TELNET ENVIRON option. -t Specifies terminal type. Supported term types are vt100, vt52, ansi and vtnt only. host Specifies the hostname or IP address of the remote computer to connect to. port Specifies a port number or service name. There doesn't APPEAR to be any options for sending commands to the telnet session or way to tell if a certain text is shown. |
|
| 7286. |
Solve : Overwritng files? |
|
Answer» Hi all, I very new to dos commands – started learning last week and really enjoyed it but this week’s been difficult for me. I trying to create a tool that would ease file manipulations. |
|
| 7287. |
Solve : to save from cmd? |
|
Answer» There is a result of the bat file. Is it possible to save the result to a txt file AUTOMATICALLY? C:\kktools\dheapmon8.1\x86>dheapmon -s Desktop Heap Information Monitor Tool (Version 8.1.2925.0) Copyright (c) Microsoft Corporation. All rights reserved. ------------------------------------------------------------- Session ID: 0 TOTAL Desktop: ( 5824 KB - 8 DESKTOPS) WinStation\Desktop Heap Size(KB) Used Rate(%) ------------------------------------------------------------- WinSta0\Default 3072 37.3 WinSta0\Disconnect 64 4.5 WinSta0\Winlogon 128 10.2 Service-0x0-3e7$\Default 512 16.9 Service-0x0-3e4$\Default 512 4.4 Service-0x0-3e5$\Default 512 5.0 SAWinSta\SADesktop 512 0.5 Service-0x0-c7a3$\Default 512 2.5 ------------------------------------------------------------- C:\kktools\dheapmon8.1\x86>pause Press any key to continue . . . Possible to see what's in the bat file at the moment? you should be able to just : > output.txt and have one... or > output.txt a:\ (if you have a FLOPPY in)thank you I found already. |
|
| 7288. |
Solve : Problems with a DOS script to rename certain files in a directory? |
|
Answer» I am trying to rename certain files in a dir, for example, for any file with ".txt" in the file name, I would like to strip out .txt and rename with the extension .cpp But what if the file name is:please type set /? on the command line and go through the text it says. you can do string replacement using set eg Code: [Select]C:\temp>set var=myfile.txt2323.cpp C:\temp>echo %var% myfile.txt2323.cpp C:\temp>set VAR1=%var:.txt=% C:\temp>echo %var1% myfile2323.cpp Quote -also, not sure what %%~nf means? please look at for /? , and right near the end, there is a description. ... %~I - expands %I removing any surrounding quotes (") %~fI - expands %I to a fully qualified path name %~dI - expands %I to a drive letter only %~pI - expands %I to a path only %~nI - expands %I to a file name only %~xI - expands %I to a file extension only %~sI - expanded path contains short names only %~aI - expands %I to file attributes of file %~tI - expands %I to date/time of file %~zI - expands %I to size of file ...... ..... Was trying to do the following with in the for loop: set var=%%f set var1=%var:.txt=% set var1=var1>>.cpp i.e. for each file name in the directory. But I the assignment to var did not work. I kept on getting the last file in the dir. Any additional help is appreciated. show the WHOLE code you have>dir/b YIELDS three files: file1.txt.cpp.03222007.cpp file2.txt.cpp.03112007.cpp file3.03012007.cpp I would like to rename them to: file1.03222007.txt.cpp file2.03112007.txt.cpp file3.03012007.txt.cpp the code is: for %%f in (*.txt) do ( REM get the filemname set var=%%f REM strip out .txt set var1=%var:.txt=% REM strip out .cpp set var1=%var:.cpp=% REM append t he extension set var1=var1>>.txt.cpp REM so the rename ren %var% %var1% ) this is the ouput and this is not what I obviously want: H:\stuff\script>for %f in (*.txt) do ( set var=%f set var1=sample.cpp03012007.cpp set var1=sample.txt03012007.txt set var1=var1 1>>.txt.cpp ren sample.txt.cpp03012007.cpp.txt var1 ) H:\stuff\script>( set var=file1.txt.cpp.03222007.cpp.txt set var1=sample.cpp03012007.cpp set var1=sample.txt03012007.txt set var1=var1 1>>.txt.cpp ren sample.txt.cpp03012007.cpp.txt var1 ) The system cannot find the file specified. H:\stuff\script>( set var=file2.txt.cpp.03112007.cpp.txt set var1=sample.cpp03012007.cpp set var1=sample.txt03012007.txt set var1=var1 1>>.txt.cpp ren sample.txt.cpp03012007.cpp.txt var1 ) The system cannot find the file specified. H:\stuff\script> -Any help is appreciated. Iggy -Thank you very much.copy *.txt *.txt.cpp If you wish to retain the .txt in the filename. If you want to transform .txt files in .cpp files: copy *.txt *.cpp |
|
| 7289. |
Solve : Running value assign.? |
|
Answer» Hi Everybody !! I have one txt file name tk.txt and want to open it five new window Something like this may work: Code: [Select]for /L %%a in (1, 1, 5) do ( start type tk.txt ) There is no NEED for the set STATEMENT as the variable is USED as a counter. Good luck. Edit: I'm not sure where the variable fits in, SINCE you never mentioned it was part of the dataset name. As used the variable is a counter for the loop.Charming!! great !! working perfectly !! ~ if we use like counter+1 then also needn't to set A lot of Thanks once again. Thanks n Regards, Jay |
|
| 7290. |
Solve : COPY EXCEL FILE.? |
|
Answer» Hi Everybody!! The best DOS can do is a bulk merge of the workbooks. Thanks!! The option copy, copy a.xls+a1.xls like i tried it didn't work. Bulk merge !! how ?? Is any dos command for excel to edit? I know you have solution in a MINUTE through vbscript. The links given by ghostdog74 is useful. Thans n Regards, Jay Quote from: Jayanand on April 03, 2007, 04:14:12 AM does the command work for word excel? |
|
| 7291. |
Solve : How to access dir in XP ??? |
|
Answer» I have a computer with HD failure. I can load the XP disk in recovery mode and access the HD with the DOS commands. I logon with the administrator password, but there are directories that it says "Access Denied" such as C:\Documents and Settings |
|
| 7292. |
Solve : How to read information from the command prompt? |
|
Answer» HI, I was wondering how I could PULL the information out of the command line interface so after I do an "Ipconfig /all" I'd like to know how to take that information and put it into a text file. I was browsing the GUIDES and commands and it seemed that the CMD command /a would be most appropriate however, I do not know how to get it to work properly. Ultimately the purpose of me doing this is to create a small program that will RUN ipconfig, and SEVERAL other commands from the computer of your choice on a domain. Any help would be apreciated. Thanks in advance. So I answered my own question I just had to follow the ipconfig command with a > directory\filename.txt Thanks anywhoAll command line switches can be seen by typing in the command and a /? after and hitting enter... |
|
| 7293. |
Solve : how to create message after the application exit? |
|
Answer» hi, 1. You didn't need the "call". Why is it there?Quote from: best007 on October 02, 2007, 07:29:22 PM anyway, is there any idea how to solve my problem? Yes! Read my last post again! |
|
| 7294. |
Solve : Make folders out of filenames? |
|
Answer» Am trying to use the for loop to make folders, the trick is that I need to name them the same as the file |
|
| 7295. |
Solve : Renaming multiple files by attaching a prefix? |
|
Answer» Hi all, |
|
| 7296. |
Solve : Batch file command line for creating a new Network Connection? |
|
Answer» Does anyone KNOW the command line to create a new network connection? I need to write a batch FILE to create a VPN connection. |
|
| 7297. |
Solve : [ask] About set /a ??? |
|
Answer» i have read set command help (set /?) more time but i'am not enough understand about "set /a operator" : Two new switches have been added to the SET command:i not clearly about set /a operator like : |,^,& anybody can give an example for using bitwise or "|" and bitwise exclusive or "^" on set /a command thanks.. How can I convert a decimal number to binary, octal, hexadecimal? Here is a way to convert a 8-bit decimal to its binary equivalent. The formulation below emphasizes extracting each bit individually. @echo off & setlocal enableextensions enabledelayedexpansion set decimal_=%1 set /a b0=%decimal_% ^& 1 set /a b1=%decimal_% ^& 2 set /a b2=%decimal_% ^& 4 set /a b3=%decimal_% ^& 8 set /a b4=%decimal_% ^& 16 set /a b5=%decimal_% ^& 32 set /a b6=%decimal_% ^& 64 set /a b7=%decimal_% ^& 128 set i=-1 for %%b in (!b0! !b1! !b2! !b3! !b4! !b5! !b6! !b7!) do ( set bit=%%b set /a i+=1 if !bit! EQU 0 (echo bit !i! = 0) else (echo bit !i! = 1) ) endlocal & goto :EOF An example of the output bit 0 = 0 bit 1 = 0 bit 2 = 1 bit 3 = 1 bit 4 = 0 bit 5 = 0 bit 6 = 0 bit 7 = 0 thanks..it's great... nice formula..i think but, i am still not clearly, especially with "^&" can u give explain that more basicly... i.e. --> - set /a "2^3" ; it return 1 - set /a "3^4" ; it return 7 what is the meaning of "^" ?? why 2^3=1 (3-2)....and 3^4=7 (3+4) ?? Some confusion because the ^ ("caret") character has 2 purposes... (1) it is used to "escape" special characters in batch files, especially the & character, which breaks commands otherwise. For example to use a & b in a batch file you MUST type a ^& b. I know this is confusing but you just have to learn it if you need to do batch arithmentic! (2) In batch arithmetic the ^ character is also the "bitwise exclusive or" operator. A bitwise exclusive or takes two bit patterns of equal length and performs the logical XOR operation on each pair of corresponding bits. The result in each position is 1 if the two bits are different, and 0 if they are the same. You can perform it manually like for school arithmetic as I shall demonstrate:- Place an 0 in the answer if the bits are the same and a 1 if they are different Quote 2 = 00000010 QED hmmm... yea, like a logical arithmetic lesson in school ...(maybe in Junior High School) it's long time AGO... littte mind about logical arithmetic but, it an OR "|" operator..not XOR [expression 1] or [expression 2] = Result if expression 1 is true and expression 2 true , result will be True if one of expression is False , result will be False ilustrate on table: Quote ----------------------note: T=True , F=False is this same think as your demonstration ??Quote from: Fen_Li on October 01, 2007, 02:44:47 PM is this same think as your demonstration ?? similar idea. thanks so far for solved my problem... that's great help... maybe, I will do some TRIAL an error....to enhance experience.. coz, 'experience is the best teacher' Regard... |
|
| 7298. |
Solve : conventional memory? |
|
Answer» I have a dell inspiron 4000 laptop, running windows me. When i turned it on the dell screen appeared and the windows me appeared and then this error message..."This program requires more conventional memory. Unload drivers or memory resident programs that use conventional memory, or increase the value for minimum conventional memory in the programs memory PROPERTIES sheet." At the top of the error box it had Explorer. I tried starting in safe mode, but I get the same error. From what I have been reading in your forums this is MS-DOS problem. I know nothing about MS-DOS Can you help me? You should check your ram is seated PROPERLY it may have COME loose.... |
|
| 7299. |
Solve : DOS Utility & Commands? |
|
Answer» Is there a DOS Utility that I can download for installation into DOS 5 or 6.22 that will permit me to use the find "TEXT string" command by SEARCHING for the string in all of the files in a subdirectory? I asked on another board if later computers made for NT and 98, when installed with dos only after a format, would have more dos commands in it because of the hardware. No!!!! Quote Let's say I have a cd with loads of subfolders in it that was burned in XP, and I put it in a cd drive using a dos based laptop's exterior cd rw drive to look through the subfolders thereof at the dos prompt. MS-DOS will show short file names Quote How do I type the gaps in the folder names such as My Documents? Ah! You DO mean "spaces". You type with quotes DIR "My Documents" COPY "A filename with spaces.txt" "c:\A folder name with spaces\a sub folder" etc Thanks for the replies, I will try this. |
|
| 7300. |
Solve : editing .ini files? |
|
Answer» hey, :2loops needed Generally, NT command language is case-insensitive, but variables are not, so "Count" is treated differently from "count".yeah i noticed that just now, it seem to work now. I have set the count an extra diget higher that then loops needed as the if line reloops if Not Equal to. nice. cheers. now i have to use the ip address i've set ealier and strat using net use \\%ip%.13 and then copy the files i need after. i'm getting there.......The other way you can do loops with a counter is to use FOR /L FOR /L %%N IN (START,step,end) DO command So this FOR /L %%N IN (1,1,10) DO ( echo %%N ) is equivalent to e.g. this BASIC code FOR N=1 TO 10 STEP 1 PRINT N NEXT N And of course you can do this set start=1 set step=1 set limit=10 FOR /L %%N IN (%start%,%step%,%limit%) DO ( echo %%N ) ok, so i've written my batch file to make x amounts of ini files with node and ip numbers. I 've also writen a loop that will copy the files to different machines (last octet counting with loop) but i now have the problem that one of the loops doesn't execpt the number 10 as a string. It seems to get 1 instead. it might be easier if i email you my batch files (i would post it here but it quite long) cheers dude! Quote from: blastman on October 01, 2007, 09:13:54 AM i now have the problem that one of the loops doesn't execpt the number 10 as a string. It seems to get 1 instead You could post the relevant bit of code on here then it would help others too |
|