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.
| 7801. |
Solve : Syntax on bacth when sendevent? |
|
Answer» I am in current directory have 2 files. One is a "abc.txt" file and one is "dt2.bat" I am new with DOS batch. All the more reason to read the documentation. |
|
| 7802. |
Solve : Is it possible to delay a batch file invisibly?? |
|
Answer» I know how to delay a batch file with "pause", "timeout" or "PING", but they all show words on the screen when delaying. I want to delay a batch file without any words being showed on the screen. Is this possible? I know how to delay a batch file with "pause", "timeout" or "ping", but they all show words on the screen when delaying. I don't THINK he's asking about hidden batch files. You can redirect the output of all these commands to NUL which just swallows the console output so that nothing shows on screen. E.g. PAUSE > NUL This can be handy with e.g. PAUSE because it means you can replace the standard message with one of your own. Example batch script below @echo off echo 1. Running PING hidden echo Approximately 5 second delay echo Starting PING. The time is %time% PING 127.0.0.1 -n 6 > nul echo Finished PING. The time is %time% echo. echo 2. Running PAUSE hidden echo Waiting for you to press a key... echo Starting PAUSE. The time is %time% pause > NUL echo Finished PAUSE. The time is %time% echo. Echo 3. Running TIMEOUT hidden echo Timeout 10 seconds or when key is pressed... echo Please Wait or press a key... echo Starting TIMEOUT. The time is %time% Timeout /T 10 > NUL echo Finished TIMEOUT. The time is %time% echo. Echo 4. Running TIMEOUT hidden again echo Timeout 10 seconds (keypress locked out) echo Please Wait... echo Starting TIMEOUT. The time is %time% Timeout /T 10 /NOBREAK > NUL echo Finished TIMEOUT. The time is %time% echo. Console output... 1. Running PING hidden Approximately 5 second delay Starting PING. The time is 7:42:07.44 Finished PING. The time is 7:42:12.48 2. Running PAUSE hidden Waiting for you to press a key... Starting PAUSE. The time is 7:42:12.49 Finished PAUSE. The time is 7:42:22.22 3. Running TIMEOUT hidden Timeout 10 seconds or when key is pressed... Please Wait or press a key... Starting TIMEOUT. The time is 7:42:22.23 Finished TIMEOUT. The time is 7:42:32.17 4. Running TIMEOUT hidden again Timeout 10 seconds (keypress locked out) Please Wait... Starting TIMEOUT. The time is 7:42:32.18 Finished TIMEOUT. The time is 7:42:42.11 timeout /t X >nul 2>&1 will wait for X seconds, allowing the user to break upon pressing any key. You can add /NOBREAK to disable this feature and only wait the specified NUMBER of seconds. The >nul will suppress any regular text and the 2>&1 will suppress any error messages. >nul cannot be removed without changing 2>&1 to 2>nul. Timeout is newly available on windows 7, so your scripts will not be backwards compatible.Quote from: Whitebeard1 on October 26, 2013, 10:21:04 PM I know how to delay a batch file with "pause", "timeout" or "ping", but they all show words on the screen when delaying. I want to delay a batch file without any words being showed on the screen. Is this possible? i guess your saying Code: [Select]@echo off ping localhost -n 6 > nul console output will be blank for 5 secs. -n 6 = 5 secs. Thanks for the reply guys. And Geek-9pm, I'm not trying to do a crime or anything, I was talking about pausing a batch file without printing out an annoying "press any key to continue"The replies were helpful. I like the >NUL command, very helpful in my batch file.Quote from: Whitebeard1 on October 27, 2013, 11:40:19 PM Thanks for the reply guys. And Geek-9pm, I'm not trying to do a crime or anything, I was talking about pausing a batch file without printing out an annoying "press any key to continue"Didn't mean to say you were. In the past, some have come here asked similar questions and then when the get what the want STRANGELY diaper and never return. BTW; There are versions of SLEEP.EXE that give no output. But the >NUL is just as good and gets the job done with tools at hand. |
|
| 7803. |
Solve : Batch file help: Creating batch files with notepad? |
|
Answer» I need help creating this batch file in notepad, and I am not getting the correct results. I hope someone can help me and point me in the right direction. Here's a framework for you to run and examine. Hopefully you can follow it and change it to suit you. That's a pretty simple way of doing what you want... but remember that if this is for an intro class, using foxi's exact script will get you busted. That doesn't look like a beginner's script. If you can understand that, then you'll know what the teacher/prof is expecting of you and you'll be able to WRITE your own (more basic) script. Also, you said: Quote from: alice8 on October 22, 2013, 04:50:43 PM None of these files should echo any of their commands to the console. was one of the requirements. If that's the case, you'll just need to modify a few things that foxi put... I'll let you figure out what things. Run foxi's script if you need to to see what actually echoes to the console. Last thing - if you don't have to use notepad.exe I'd personally recommend Notepad++. It's FREE and has syntax highlighting as well as language presets. Makes things a lot easier for me personally. Thanks foxidrive, this is very helpful! And kyle_engineer I will make sure its a more basic script, thanks! If you get into programming .bat files heavily, you might want to use this program: http://www.contexteditor.org/ It has the syntax highlighting & language presets, plus you can also program a button to testrun your batch file. I use it to 'save and run' in one click. After every major change I make in my .bat file, I click the button to run it. Saves a lot of time. |
|
| 7804. |
Solve : with code i need to use!? |
|
Answer» Hello, @echo off and something.txt list look like this: Quote 1 if you know a code to do this, pleas answere -lukeIf you want to use GnuSED than this will work for any line - this example uses line 4 Code: [Select]@echo off for /f "delims=" %%a in (' SED 4!d "file.txt" ') do set "var=%%a" echo "%var%" This will do the same but it has issues with blank lines, and lines starting with ; by default. Code: [Select]@echo off for /f "skip=3 delims=" %%a in (' type "file.txt" ') do ( set "var=%%a" goto :2 ) :2 echo %var% I tend to use a counter, and an if statement. I guess it's just personal prefferance after awhile. Code: [Select]@echo off set a=0 setlocal EnableDelayedExpansion for /f "delims=" %%A in (file.txt) do ( set /a a+=1 if "!a!"=="4" echo %%A ) You don't need to have 'type' in your for loop. (FILENAME.txt) works the same way. EDIT: Example also uses line 4.Quote from: Lemonilla on January 12, 2013, 07:21:17 AM I tend to use a counter, and an if statement. I guess it's just personal prefferance after awhile. You do need to use 'type' if there are long filename elements in the filename. Or usebackq And yes, it is personal PREFERENCE in a lot of the things you can script. You can modify the code to get the Nth line by skipping N-1 lines if you use SKIP in the options block for example to get the 4th line you skip the first 3 @echo off for /f "skip=3 delims=" %%k in ( ' type "something.txt" ' ) do set MyLine=%%k & goto next :next echo %MyLine% pause if you want to avoid the FOR behaviour mentioned by foxidrive you can use the old trick of FINDSTR with: /N - which prefixes each line with a number and a colon /R "^" - use the regular expression "^" which means "all lines" and then by using "tokens=1* delims=:" separate the prefix and use an IF test to get the line you want set num=4 for /f "tokens=1* delims=:" %%A in ('findstr /N /R "^" "something.txt"') do if "%%A"=="%num%" set Myline=%%B echo %MyLine% Quote from: Salmon Trout on January 12, 2013, 08:35:32 AM if you want to avoid the FOR behaviour mentioned by foxidrive you can use the old trick of FINDSTR with: That technique then has issues with leading : characters. Sed is a tool that Microsoft should have included as it's built for editing text. I guess Powershell has ways to do it too - and there's always VBS to fall back on. There's more than one way to skin a cat! Quote from: foxidrive on January 12, 2013, 08:46:30 AM There's more than one way to skin a cat! I guess it comes down to WHATEVER tool you feel happiest with. I tend to use VBScript these days - for the task mentioned above I would just read the file into an ARRAY and get the desired line.Thank you all for your help, i use this code to set languages so i can make a list of translated words/phrases if i ready with this file i will post the finaly version if i am proud about it -luke |
|
| 7805. |
Solve : Align text in batch file? |
|
Answer» Hi, You dug up a 7 year old thread that I don't see how what you posted solved the OP's original question. The question as stated was essentially unanswered, so see here, Google indexer! It is a simple matter to justify text in a batch script by padding it on the left or right with a suitable number of a pad character e.g. space, dot, whatever and then take a slice of desired length (as long as, or longer than the max length to be processed) starting at the left or right. These are just simple examples and of course refinements are possible. REM left justify text within a column 16 characters wide set string=some text REM add an excess of pad characters (i.e. more than 16) REM Note: use quotes if pad characters are spaces set "string=%string% " REM Show the justified column as a slice starting at position 0, of length 16 echo Prefix %string:~0,16% Suffix REM right justify text within a column 16 characters wide set string=some text REM add an excess of pad characters on the left set string= %string% REM Show the justified column as a slice ending at the string end, of length 16 echo Prefix %string:~-16% Suffix |
|
| 7806. |
Solve : Need help with batch file calling text contents into batch commands? |
|
Answer» Please help as i would like to make the following 1. test.txt (NO SPACES) With great thanks. Added knowledge Actually what i needed is shown below. Sorry for not putting it clearly 1. ipadd.txt ip1=192.168.100.232 ip2=192.168.100.233 2. ping.bat @echo off cls ping %ip1% pause 3. Console output should be Pinging 192.168.100.232 with 32 bytes of data: Reply from 192.168.100.232: bytes=32 time<1ms TTL=255 Reply from 192.168.100.232: bytes=32 time<1ms TTL=255 Reply from 192.168.100.232: bytes=32 time<1ms TTL=255 Reply from 192.168.100.232: bytes=32 time<1ms TTL=255 Ping statistics for 192.168.100.232: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss) Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Tried to research but still couldn't find the correct method Well, all you need to do now is edit your batch file. The most obvious problem is that you have called your batch file the name of a system command, and in this case ping.bat will call itself again and again. Call this IPPing.bat or something simpler like IP.bat Code: [Select]@echo off for /f "tokens=2 delims==" %%A in (ipadd.txt) do ( cls ping %%A pause )Quote from: foxidrive on October 25, 2013, 05:20:44 AM The most obvious problem is that you have called your batch file the name of a system command, and in this case ping.bat will call itself again and again. it works for the first line of the ipadd.txt how do i ping to the 2nd line of the ipadd.txt ip1=192.168.100.232 ip2=192.168.100.233 sorry for asking noobie QUESTIONS It pings the first IP address, Then you press any key and it will ping the second IP address and then when you press any key it will finally quit.Below are my scripts currently For Main Bat file named: ServerTest.bat Code: [Select]@echo off cls :start echo *************************************************** echo ********* Please Select The Server You WANT Ping ******** echo *************************************************** echo. echo 1. To Ping Server 1 echo 2. To Ping Server 2 echo. echo 0. To Quit echo. set /p choice="Enter your choice: " if "%choice%"=="1" goto Server1 if "%choice%"=="2" goto Server2 if "%choice%"=="0" exit echo Invalid choice: %choice% echo. pause cls goto start :Server1 cls C:\"SScript"\"Server1" goto :start echo. :Server2 cls C:\"SScript"\"Server2" goto :start echo. exit For another bat file that was called from main as shown below; Server1.bat Code: [Select]@echo off echo. [color=RED]for /f "tokens=2 delims==" %%A in (tsip.txt) do ( cls ping %%A[/color] goto :start ) :start echo. echo 1. If Reply. Continue Script echo. echo 2. Go Back to Main Menu echo. echo 0. To Quit echo. set /p choice="Enter your choice: " if "%choice%"=="1" goto Script if "%choice%"=="2" goto MainMenu if "%choice%"=="0" exit echo Invalid choice: %choice% echo. pause cls goto start :Script Start telnet.exe [color=red]192.168.100.232[/color] cscript sendkeys.vbs echo. call "ServerTest.bat" :MainMenu cls start C:\"SScript"\"ServerTest.bat" :exit exit I want to avoid using many server1.bat, server2.bat, etc... So thats why i wanted to know instead of creating so many server bat files with different IP address. Is there a way of calling those highlighted in red from text file based on the specific lines? IPadd.txt Code: [Select]IP1=192.168.100.232 IP2=192.168.100.233 IP3=192.168.100.234 Appreciate with all the information given =)for /f "delims=" %%A in (IPadd.txt) do call server1.bat "%%A" then change all INSTANCES of the ip address stored in IPadd.txt to %~1. Just make sure at the end you have an exit /b |
|
| 7807. |
Solve : how to "copy" using a .bat to parent directory?? |
|
Answer» hi, |
|
| 7808. |
Solve : Task Scheduler? |
|
Answer» Is it possbile to have a batch or vbscript to change the passwords for all your WINDOW task shedules in Windows xp? It really PAIN to go into each shedule and change the password everytime we have to change our password for windows. |
|
| 7809. |
Solve : Can't get batch file to start program in partition? |
|
Answer» I've researched this a fair bit. Can't get an exe on a different partition (M:\program files\grisoft\avg free\avgw.exe) to open when I'm logged into my D: drive partition. Tried the quotes (start "M:\program files\grisoft\avg free\avgw.exe") & short filename (start M:\progra~1\grisoft\avgfre~1\avgw.exe)(ALSO tried it in quotes). Windows XP, Fat32 on the D partition, M partiton is formatted Fat32, no o/s.What error message did you receive? "Bad command or filename" usually means a typo or the file does not exist. Some programs need components to run. If you run from an icon, the "Start in" parameter usually takes care of where to look. In a batch file or at the command line you may have to change directory to the .exe location before you can run. |
|
| 7810. |
Solve : command to list filenames in dir into a textfile? |
|
Answer» a COMMAND to list every FILENAME in dir into a textfile.... i believe this is possible i think someone i WORKED with in the past did this... |
|
| 7811. |
Solve : Batch file to make new folder fails to work? |
|
Answer» Hello, I can't figure why it works at home but not in work. Possibly you do not have sufficient permissions. If this is a work computer you need to contact the system administrator. Also, does the %date% variable CONTAIN characters that would be illegal in a file or folder name? usually permission restrictions on the network gives a pop up message. But running this gives nothing. The date variable as from attached example contains nothing illegal.Quote from: ftfk on October 24, 2013, 02:14:10 PM usually permission restrictions on the network gives a pop up message. You won't necessarily get a POPUP with a batch script. Try adding this one line to the end of the batch script: PAUSE Then the command window will stay open until you press a key and you can see if the system is trying to tell you anything. |
|
| 7812. |
Solve : Closing by Batch FIle? |
|
Answer» [size=16]Is there any command for a batch filethrough which i can close a program or WINDOW?[/size] |
|
| 7813. |
Solve : how to lanch game from foppy? |
|
Answer» how do i lanch a game from a FOPPY in DOS. i was told you can do it. the NAME of the EXE is ROF.exe PLZ tell me how to do itChampagne launches ships! MAY be the run command. |
|
| 7814. |
Solve : asking for help with text management in batch files? |
|
Answer» Hi, |
|
| 7815. |
Solve : tranfer ms dos to diskett? |
|
Answer» my computer breakdown, and i can get to my files, i haVe to TRANSFER my information from MS DOS to diskett, cause i DONT want to lose all my information. how CA i so this?? |
|
| 7816. |
Solve : Deleting Desktop Icons using batch file? |
|
Answer» Hi! |
|
| 7817. |
Solve : Giving ALT-F4 command in batch file? |
|
Answer» If I want to hit on ALT+F4 using a batch file, how would I go about by writing it in the batch file. |
|
| 7818. |
Solve : Finding files? |
|
Answer» I don't know the directory a file is saved in, is there a command that can tell me where it's located?In WINDOWS (some VERSIONS): Start-->Search |
|
| 7819. |
Solve : How to open windows command prompt with admin rights??? |
|
Answer» i need to CHANGE the PC IP ADDRESS from command prompt which is possible when we have admin RIGHTS,So is it possible to change the rights from local to admin from windows CMD prompt. .Have you tried using RUNAS and then the command? i need to change the PC IP address from command prompt which is possible when we have admin rights,So is it possible to change the rights from local to admin from windows CMD prompt. . Does this need to be done from command prompt? Because it will require the same right/privledges from command prompt as it does from the TCP/IP Config GUI... |
|
| 7820. |
Solve : samsung hd103sj faulty!!? |
|
Answer» In the control PANEL USER applet you can remove users. |
|
| 7821. |
Solve : Update computer date, time, and timezone? |
|
Answer» Is there any way to update the current date, time, and timezone from time.gov or time.windows.com without requiring the user to make any manual adjustments? I currently have my script to do a resync, but it doesn't automatically update the current date, time, and timezone if they're incorrect. For my work-around, I start the timedate.cpl so the user manually CONFIGURES it, but I need something that is automated. |
|
| 7822. |
Solve : Xcopy Batch File? |
|
Answer» Hi,
I'm wondering if this COULD be a limitation of xcopy itself. In another forum this is what someone said: "xcopy cannot copy open/locked files and an admin doesn't own all the file system in Windows now." What doesn't make sense is that I do have access to these files, but xcopy doesn't for some reason. Is there any way to run a batch file in some kind of admin mode? As another option I would be happy to buy a program to do this for me. All I'm looking for is a program that copies changed files to a flash drive and then resets the archive bit on the source file. I would like to have the files be readable on any PC, so compression or proprietary formats wouldn't work. An image or clone program wouldn't be the answer either. Do you know of any programs that could do this? Thanks.Quote from: DigitalDawn on January 15, 2013, 04:04:32 AM Is there any way to run a batch file in some kind of admin mode? Right click the batch file and run it as admin/with elevated permissions. See if that does it as you expect it should.No that didn't work either. :-( The essence of the problem has to do with ownership of files and folders. Windows can have multiple users on a machine and the expectation is that they can each have files which other users cannot view or use. This user system LEADS to admin users and other classes who can use takeown.exe and cacls.exe to change permissions on the file system and give the ability to access certain system and user folders. If you have no expectation of security on your computer then you can give permission to each file and folder to "Everyone" which is a user privilege that is very low in the security hierarchy. Windows isn't designed to allow this - some folders will revert to system access repeatedly - and this will allow malware to gain access easily too. Another way around this is to create a folder which you use to save every personal file into, in a category of sub folders, and then backup this 'master' folder which contains all your files. You might also like to investigate XXclone which can backup the entire hard drive to a USB device (or internal drive) in file mode - and each backup only copies the changed/new files and gives you a mirror and bootable backup. The benefit is that after the initial backup then each subsequent backup is very swift, of the entire system. You can access every file in the backup the same way you can on your master drive. The backup hard drive only needs to be as large as the files, so you can backup to a smaller HDD than the primary c: drive. Robocopy is a command line tool that is similar to xcopy but it also skips existing files in the backup, so is swift. It has mirror backup capability too. Similar to xcopy, it cannot copy files and folders that your user does not have permissions to access. I hope that illuminates the issue somewhat...Thanks for your detailed response. I checked out XXClone and it really isn't going to work because it requires a full-clone backup initially, which I can't do with a flash drive. Same thing for Acronis and other similar programs. |
|
| 7823. |
Solve : call another batch file on a particular day? |
|
Answer» I have been given the job of creating a script to call five scripts called Monday to friday on a domain controller. So instead of five tasks in windows backup i create ONE script that calls one of the other day scripts i suppose it would go along like this. This is a straight forward way of doing it, but depends on the %date% variable format. Also a workable method! |
|
| 7824. |
Solve : Batch list and create a txt from listing inside another txt!? |
|
Answer» Hi! |
|
| 7825. |
Solve : Batch quiz menu help? |
|
Answer» Hi, Batchmaniac800 here. I am making a simple batch quiz for fun, but I can't figure out the command to make any input besides the one I specified to make you stay on the menu. I think it's the "if not start goto MENU", but i'm not really sure. I TRIED it but it didn't work. Can ANYONE please give me the command? I have underlined the PART I have trouble with. Here is my start: |
|
| 7826. |
Solve : Random numbers? |
|
Answer» Hi friends. I'm slowly coming to grips with notepad++ you may not need %flag% at all, but it's never a bad idea to have fail safes. This is what I believe is called "cargo cult programming" http://en.wikipedia.org/wiki/Cargo_cult_programming If X is Y { If X is really Y { $Do_Something } } correct me if I'm wrong, but since batch is linear in its processing, you don't need anything to do that, you just need to sequence the IF statements correctly. e.g. Code: [Select]REM set num set /a num=%random%*100/32768+1 REM argue num value if '%num%' LSS '21' goto result if '%num%' LSS '70' goto result if '%num%' LSS '96' goto result if '%num%' LSS 101 goto result goto error REM check result :result echo your random number is: %num% pause > nul REM just in case :error cls echo there has been an error. Since each IF is arguing "less than (as exact value)" and it has a GOTO as the result, so it will GOTO result if in range, otherwise go on to the next argument. If a value passes through <21, then it's bound to hit one of the following segments... Anyway... not sure if that logic MADE sense... lolIn ESSENCE you're right - but you've forced an ascii compare in your code, and got a number out by one. Based on your code, this kind of thing will work: Code: [Select]if %num% LSS 21 goto resultA if %num% LSS 71 goto resultB if %num% LSS 96 goto resultC if %num% LSS 101 goto resultDQuote from: foxidrive on October 16, 2013, 07:03:38 AM In essence you're right - but you've forced an ascii compare in your code, and got a number out by one. Yeah, I just kinda spat that out as an example. but since the number will only progress to the next IF argument if it exceeds the current range, then there's not really much need to scale floors and ceilings by nesting the statements - it's just letting DOS do it's thing. LOL! Anyway, it's always nice to make the script less verbose if POSSIBLE. |
|
| 7827. |
Solve : help with that *.*? |
|
Answer» Hello, Echo. > *.txtIs always wrong. File redirection must have a SINGLE target. The expression *.TXT COULD mean one file, or a thousand files. It is to be used in command that can have multiple targets. D:\>cd dos D:\DOS>Echo. > *.txt The filename, DIRECTORY name, or volume label syntax is incorrect. D:\DOS> What is it you want to do?Quote i'm using it to clear contents of txt,dat,biz and doc files and type new content for %%A in (*.txt *.dat *.doc) do echo. > %%AQuote from: Geek-9pm on October 14, 2013, 10:15:44 AM Is always wrong. this is my problem ... Many Thanks for your reply Quote from: Salmon Trout on October 14, 2013, 11:46:11 AM for %%A in (*.txt *.dat *.doc) do echo. > %%A Many Thanks man.. This Command works with me ,,, Many Thanks again ... |
|
| 7828. |
Solve : Batch "book" needs editing? |
|
Answer» So I spent the last while (something like 2 months) compiling all of my knowledge of Batch into a "book". The good majority of it is probably wrong. I was wondering if you guys would mind reading a BIT of it, and pointing out any errors or mistakes I may have. I don't expect anyone to read the whole thing (23 pages), but even a chapter would help immensely.
Just did a quick skim of the first chapter and the code examples. Might read it some more tonight. Here is what I noticed on my lunch break.Oops... Can't believe I made that mistake. Quote from: DigitalSnow on January 15, 2013, 11:07:59 AM I didn't know that. Thanks, I'll be sure to make the changes. Not sure if you ever heard of the M.U.F's listing before, but there is a Microsofts Undocumented Features txt file out on the net that has a list of neat features that have been discovered. Worth looking into if you haven't already. Some undocumented features still work, while others are degraded or no longer active. Might be something to add link to in your book for anyone who might need a DOS command to do something special in a batch file. This hasn't been updated in years though, and any use of such instructions is at own risk: http://archive.hmvh.net/txtfiles/it/MUF15.TXTQuote If you've read many of these books, this SECTION is usually used to explain the inner workings of a computer and it's history. There should not be an apostrophe in its. Quote Any word (or string of characters) beginning with a single colon ( [but not two] is what I like to call a 'flag'. I like to call them 'labels', like Microsoft does. Quote but to that my friend I say Nay! I think you need to develop a more serious and formal English style, and also there are lots and lots of spelling mistakes. Quote from: DaveLembke on January 15, 2013, 03:13:54 PM Not sure if you ever heard of the M.U.F's listing before, but there is a Microsofts Undocumented Features txt file out on the net that has a list of neat features that have been discovered. Worth looking into if you haven't already. Some undocumented features still work, while others are degraded or no longer active. Might be something to add link to in your book for anyone who might need a DOS command to do something special in a batch file. This hasn't been updated in years though, and any use of such instructions is at own risk: http://archive.hmvh.net/txtfiles/it/MUF15.TXTI have not heard of it, but will look into it. Thanks! Quote from: Salmon Trout on January 15, 2013, 03:32:48 PM I like to call them 'labels', like Microsoft does.I mainly learned from analyzing pre-written code, so I never did learn the names for THINGS. Thanks. Quote from: Salmon Trout on January 15, 2013, 03:32:48 PM I think you need to develop a more serious and formal English style, and also there are lots and lots of spelling mistakes.I was trying to make it informal. I figured it would help readers (who don't know much about code/scripts) to better understand how things worked. I was also trying to make it more engaging, I know that the c++ book that I am working through right now, uses lots of fancy words, and its dead dry. And I was expecting the spelling mistakes, I hope it wasn't too much of a distraction.Quote from: Lemonilla on January 15, 2013, 07:21:35 PM I was also trying to make it more engaging For many readers, an excessively chatty style, coupled with a zillion spelling mistakes says "I'm aged 13!" and makes it less engaging. |
|
| 7829. |
Solve : Delete spaces from filenames?? |
|
Answer» Hi, |
|
| 7830. |
Solve : Help with this script please? |
|
Answer» I'm trying to GET the desktop shortcut that contains the url of alldata to be deleted. The SCRIPT locates the file, but for some reason doesn't delete it. Please help! |
|
| 7831. |
Solve : MS DOS can not identify pipeline charactor? |
|
Answer» Hello all, |
|
| 7832. |
Solve : Batch File with variable Filenames? |
|
Answer» Hi! |
|
| 7833. |
Solve : Kill command in DOS? |
|
Answer» Hi! Is there a command that can be USED to kill an application. I know one in unix but not too sure abt DOS |
|
| 7834. |
Solve : Password Protecting Files? |
|
Answer» How do you protect a file with PASSWORDS using MS-DOS? |
|
| 7835. |
Solve : Long File Names? |
|
Answer» I have jsut started working with the Command Line on my microsoft xp and I have a few questions about how i do some things. I know the commands to everything i just dont know how to type it all correctly. |
|
| 7836. |
Solve : How to modify the default printer in a Batch ???? |
|
Answer» Hi everybody ! |
|
| 7837. |
Solve : Run exe (with answering promoted questions) in a batch mode? |
|
Answer» Hi All, What do you mean "Put the answers to the questions in a text file and redirect it, or pipe it into the dos program." Yes, that is the technique. See above for the command lines. You can put the filenames in a single text file and read them in for you 100 loops.I have to say - super! Thank you a lot! You simply make my day! |
|
| 7838. |
Solve : Batch file to add to a text file? |
|
Answer» I need to create a batch file, that can open a text file, add 4 lines of text to it, save and close it. |
|
| 7839. |
Solve : autoexec.bat? |
|
Answer» Hi there, |
|
| 7840. |
Solve : Emachines Format? |
|
Answer» I am haveing TROUBLE manually formating my emachines COMPUTER. I need to completely remove windows Xp so I can do an uninstall. |
|
| 7841. |
Solve : Batch File FTP Help Needed? |
|
Answer» I'm trying to make an FTP updater using a batch file so I use two files; one the script, and one the batch file that runs it. |
|
| 7842. |
Solve : Deleting file older that a certain date? |
|
Answer» Does anyone know how I can write a bat file to delete files in a directory that are more than say 31 days old? |
|
| 7843. |
Solve : Arrays in batch files? |
|
Answer» HI, i write a code to read the input values while running the SCRIPT. I want to store those values in array and use them later in the script. How can i GET this? thanks, Use the set command in a loop. Quote @echo off If you DESCRIBE exactly what you want to do it would help us to provide some code. |
|
| 7844. |
Solve : Batch File Using Wget? |
|
Answer» I'm trying to write a basic batch file that will download files from an ftp site that contain a date/time stamp, but I'm having difficulties. Why not just download all the files in a directory and then select the ones that match the time stamp you want?Thanks for the replies. I could do what Geek suggested and download all files on the FTP site and just KEEP the current files, based on the datestamp, but I'm sure there is an easier way of passing the date/time stamp into the filename. Foxidrive, you are right that the files from the ftp site have the date/time stamp in their name, so I only wanted to download the current ones. A sample URL is below: ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.2013012400/ So, how can I put the time/date stamp (2013012400) into the wget command: wget ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.%MODELTIME%/Another approach might be to use WGET to get a file listing of what is in the ftp directory: Code: [Select]wget ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/ This will produce an index.html file. You could try using batch, but a better solution would be VBScript or Powershell (both available on your machine) to parse the index data and find the most recent files. Next step would be to use WGET again, this time with specific file names. Just a thought. |
|
| 7845. |
Solve : Please assist with a small script? |
|
Answer» I have a small script that I got from the net. This script basically reads the information (ip addresses) from a file and pings them and then inserts the results a text file. This script does exactly what I need but the issue is that instead of ping I need “pathping” which I change in the script. The issue is that during pathping if there is a delay the script sits for like 3 minutes or maybe 5 MINUTE depending on the response. -w timeout Wait timeout milliseconds for each reply. Such as 5000 millisecond timeout window to timeout after 5 sec with no response? Quote for /F %%i in (iplist.txt) do pathping -w 5000 %%i >> result.txt C:\>pathping /? Usage: pathping [-g host-list] [-h maximum_hops] [-i address] [-n] [-p period] [-q num_queries] [-w timeout] [-P] [-R] [-T] [-4] [-6] target_name Options: -g host-list Loose source route along host-list. -h maximum_hops Maximum number of hops to search for target. -i address Use the specified source address. -n Do not resolve addresses to hostnames. -p period Wait period milliseconds between pings. -q num_queries Number of queries per hop. -w timeout Wait timeout milliseconds for each reply. -P Test for RSVP PATH connectivity. -R Test if each hop is RSVP aware. -T Test connectivity to each hop with Layer-2 priority tags. -4 Force using IPv4. -6 Force using IPv6.Thanks for the reply. Correct though there is a w (timeout FEATURE) but it would wait for certain time (e.g 250 sec) before MOVING to the next IP. I would like it to move to the next IP right away if there is a delay of more then 10 - 15 sec...Thanks.-p period - Wait period milliseconds between pings. -w timeout - Wait timeout milliseconds for each reply. When -p is specified, pings are sent individually to each intermediate hop. When -w is specified, multiple pings can be sent in parallel. It's therefore possible to choose a Timeout parameter that is less than the wait Period * Number of hops. so i think "pathping -p 15000" this will work. Try this (15000ms i.e 15 sec) |
|
| 7846. |
Solve : Random number less than x? |
|
Answer» i am making this batch file and basically i need to generate a random number LESS than or equal to 25. |
|
| 7847. |
Solve : my computer is running in DOS mode only? |
|
Answer» i have a computer that has windows 98 and it is running in the DOS MODE only it logs on like it going to come up but then it jumps with back into the DOS mode what can I do do I just throw the computer away or what PLEASE help Quote ...what can I do do I just throw the computer away or what please help If you want to throw it away, why do you come here for help? THROWING away a computer is not very green of you. Lot's of toxic SUBSTANCES in a PC. Anyway, just type win at the command prompt. Hope this helps. |
|
| 7848. |
Solve : .bat to update hostfile? |
|
Answer» I need help with making a .bat to download a .zip file from http://winhelp2002.mvps.org/hosts.zip and extract and replace the file host file in C:\Windows\System32\drivers\etc automatically. I have searched researched and TRIED but cannot get to work. |
|
| 7849. |
Solve : Updating window to the current date and time from time.nist.gov? |
|
Answer» Is there a way to update windows to the current DATE and time using time.nist.gov or time.windows.com? If I change the time and date, I would like this script to automatically update my computer to the current date and time without me setting it manually. This is what I currently have in place but doesn't set the correct date and time if altered: |
|
| 7850. |
Solve : Batch files and typing words? |
|
Answer» I have MADE a file that opens up a page on the internet which requires you to sign in. I was wondering if there was a way for the file to automatically type in username, and (TAB) and then password, and then enter to LOGIN. is it possible for the .bat file to type in buttons on the keyboard??Sendkeys using VBS or an AutoIt script should work. |
|