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.
| 1801. |
Solve : Launch Matlab and launch commands from MS-DOS? |
|
Answer» Hello, |
|
| 1802. |
Solve : Close Firefox with a bat? |
|
Answer» I'm trying this |
|
| 1803. |
Solve : Another simple xcopy question...? |
|
Answer» I would like to echo the date and time to an error text file, which sends ERRORS from xcopy like this: |
|
| 1804. |
Solve : xcopy for specific files and their folders? |
|
Answer» Greetings. After I perform a subset, I will be able to pull out all the paths of the files I need from the database, format them as needed and paste them into a txt file, thus my attempts at using the .xcf files with xcopy.then CONSIDER it done because you already have the list of file path in a file. now need a little bit more information: 1. is this file path is full-path-name or relative-path-name? 2. would you mind to post couple of lines from the xcf file. i am thinking to do it in a simple for loop and light-weight copy function.Thank you Reno. You give me hope. I just spent another couple hours looking for solutions and it may involve setting parameters in a batch file, but again, I'm not fully understanding what I'm seeing. So far, I've been using full-path-names, as that is how I've been able to successfully copy files across the network. Below is a sampling of the files I need to copy and create the directory structure for. As you can see, there are a variety of directories and only a few files from each. "T:\! Field_Verification_Data\BW\Big Walnut27\50.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\48.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\87.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\58.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\62.jpg" "T:\! Field_Verification_Data\BW\Big Walnut101\90.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\70.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\73.jpg" "T:\! Field_Verification_Data\BW\Big Walnut101\70.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\80.jpg" "T:\! Field_Verification_Data\BW\Big Walnut100\55.jpg" "T:\! Field_Verification_Data\BW\Big Walnut100\38.jpg" "T:\! Field_Verification_Data\BW\Big Walnut56\68.jpg" c:\pics /oAlog/h/c/e/r/y I don't mind concatenating what is needed to each entry to allow this to work, so I look forward to your suggestions. f.y.i. I'm including a bit of coding I found that may be something to consider as well, but I'll await your suggestions. echo off for /F "tokens=*" %%* in (c:\Files.txt) do xcopy /y /c /d /h "%%*" d:\Target\ Quote from: garv on May 28, 2009, 09:41:47 AM "T:\! Field_Verification_Data\BW\Big Walnut27\50.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\48.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\87.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\58.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\62.jpg" "T:\! Field_Verification_Data\BW\Big Walnut101\90.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\70.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\73.jpg" "T:\! Field_Verification_Data\BW\Big Walnut101\70.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\80.jpg" "T:\! Field_Verification_Data\BW\Big Walnut100\55.jpg" "T:\! Field_Verification_Data\BW\Big Walnut100\38.jpg" "T:\! Field_Verification_Data\BW\Big Walnut56\68.jpg" c:\pics /oAlog/h/c/e/r/ybefore i write something up, need to confirm a few things: is it no line-break between each entry? or the formatting is loss due to copy&paste from unix system maybe?? what is this last line mean - c:\pics /oAlog/h/c/e/r/y? there is a limit in cmd a certain number of characters in a variable. if you able to format the file like this: Code: [Select]"T:\! Field_Verification_Data\BW\Big Walnut27\50.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\48.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\87.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\58.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\62.jpg"then a batch code would be possible, otherwise i need to do it in another scripting language, such as vbscriptCorrect, what I pasted has no line-breaks between entries, however if I need line breaks (or commas, tabs etc.), I can make it that way. The last line is what I was using as the destination directory (this can be anything), and the remainder were xcopy switches including the creation of a log file for errors, which I have found helpful in the past.for this text format with line break, support unlimited number of entry: destination directory is at the top for performance sake, if you put the destination directory on the last line, it will take a long time for large list Code: [Select]c:\pics "T:\! Field_Verification_Data\BW\Big Walnut27\50.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\48.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\87.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\58.jpg" "T:\! Field_Verification_Data\BW\Big Walnut27\62.jpg"the batch code: Code: [Select]echo off & setlocal set /p dest=<test.txt if %dest:~-1%.==\. set dest=%dest:~0,-1% for /f "skip=1 tokens=*" %%a in (test.txt) do ( if not exist "%dest%%%~pa" MD "%dest%%%~pa" && echo created "%dest%%%~pa" echo copying "%%~a" copy "%%~a" "%dest%%%~pa" )Reno, FANTASTIC. I tested what you posted and it worked, then I chose a more complex set of paths and files and it worked perfectly. That is exactly what I'm in need of. Rest assured it will be put to good use. If it is ok with you I will make this available to other people that have had the same issue that I was dealing with; there are many. If you'd like to receive some feedback or credits for this I know a place we can probably post it. Let me know your thoughts. In the mean time I will spend some more time deciphering what you created and test it in some different ways. Once again. Fantastic. Thank You.glad it works well. feel free to modify and give it to your friends, just dont put my name on it, i'll be ashamed if my name tagged somewhere for such a simple script. if the simple script help you out somehow, you only need to click "thanks at post #11". that's more than enough btw, click once only, i don't like cheating Reno, I clicked the thank you button 'once' for you yesterday right after I tested the script. If I can do what I'd like to with the script I will give you an update, it really could help a lot of people. Have a good weekend. - joshReno, I'd like to join in on the thank you's here!! In researching the very issue and need over the past two days (and many experiments later), I came across this thread and was able to IMPLEMENT your .bat in the exact MANNER I needed. Best regards, L. Burr |
|
| 1805. |
Solve : batch file to rename files based on content? |
|
Answer» I am trying to write a batch file that will: |
|
| 1806. |
Solve : dos syntax - $ and network path? |
|
Answer» If I am defining a network path in a net use command example is net use K: \\test\test$ The $ is used to denote a hidden share on the server. Any Shares that end with the $ will not be published or visible. You have to now the share name to access. or if you need to KNOW the share's on your system you can right click My Computer manage click the + Shared Folders and then select shares all shares including administrative shares will show up.you will also need user/password followed by that command if you dont already have passthrough AUTHENTICATION at the windows permissions level. "This can be dangerous if PLACED in a BATCH, in a batch that other users have access to with lesser permissions or in an environment where anyone can view the batch with that mapping and credentials in the open." |
|
| 1807. |
Solve : Log File? |
|
Answer» Hey guys, Log__07092009.txt |
|
| 1808. |
Solve : Batch file to run multiple programs - error on command line? |
|
Answer» I'm new to BATCH files and have read the beginner MATERIAL on here. I can get certain programs to run through my batch file but others I can't because of the spaces in the file path. I have already done the simple things mentioned on this site like adding the quotation marks but that doesn work. Okay I figured out what I'm doing wrong. here is how the command line should look:Quite strange, I haven't seen a path with more than one set of quotes...but start "C:\Directory Here\file name.exe" should work...I had the same problem but when i removed the start command and checked my spelling it did work |
|
| 1809. |
Solve : XCOPY - .bat to all users? |
|
Answer» I'm trying to RUN a batch file that deploys files from our file server to the all users startup folder and C drive without having to manually drag each file to its destination. When I copy the files from the network path to the WINDOWS DIRECTORY, all is well. When I copy to the C:\Documents and Settings\All Users\Start Menu\Programs\Startup I get "The syntax of the command is incorrect". I guessing I need the old school ~ paths but I'm not sure what I need to do. Help please.Nevermind I figured it out. You must use quotation marks around the path. Quote from: prosportal on July 02, 2009, 03:29:21 PM Nevermind I figured it out. You must use quotation marks around the path.GOOD for you! One thing to make it so you won't get that error again is to ALWAYS use QUOTES around paths. |
|
| 1810. |
Solve : passing password? |
|
Answer» how can i pass password to ssh. i m able to pass username by using belw given command |
|
| 1811. |
Solve : BATCH to format text in files .txt? |
|
Answer» Hello, if you have gawk for windows(see my sig) Sorry I forgot to say that I'm using W2K OS. Ty, but i can't use "gawk for windows". Quote from: SuperSteaua on July 01, 2009, 12:57:54 AM Sorry I forgot to say that I'm using W2K OS.gawk works on W2K as well. Its a matter of whether you want to download it or not. Its only a one time effort if you want to download and use it. However, if not, i have also shown you example of vbscript in the link. you can try that.heh, "I Have windows, so I can't use Gawk for windows" classic. Code: [Select]echo off setlocal enabledelayedexpansion for /f %%a in (a.txt) do ( if not !num! equ 3 (set line=!line! %%a) ELSE ( set num=0 echo !line! set line=%%a ) set /a num+=1 ) echo %line% pause C:\>type strcat.bat Code: [Select]echo off setLocal EnableDelayedExpansion set /a c=0 for /f "tokens=1-3 delims=" %%a in (strcon.txt) do ( set /a c+=1 set str!c!=%%a set Final=!str1! !str2! !str3! if !c! EQU 3 echo !Final! if !c! EQU 3 set /a c=0 && set str1= && set str2= && set str3= ) echo %Final% Output: C:\>strcat.bat 111111111 222222222 333333333 444444444 555555555 666666666 777777777 C:\> C:\>type strcon.txt 111111111 222222222 333333333 444444444 555555555 666666666 777777777 C:\> Quote from: billrich on July 01, 2009, 09:23:08 AM C:\>type strcat.batyour SCRIPT doesn't take care of more input lines.07/02/2009 : More input lines now possible. See post # 6 Bill Quote from: gh0std0g74 on July 01, 2009, 10:16:58 AM
Devcom post#5 beat me to the draw. His code is complete and nearly perfect. I'm still learning. Maybe the non Batch solutions should be on another Board? We might be overloading the newbies?I have to say that I realy can't use other STUFF than batch, because I use it on a server of an CLIENT and I can't INSTALL on it softweare without permision. And offcourse I don't have permision. Quote from: devcom on July 01, 2009, 08:45:52 AM Code: [Select]echo off This one seems to do the trick. But I didn't succeed to put the result into a result file DEVCOM if u can refine it please. As for the other program it didn't worked for me. Thank you in advance for u'r help. Code: [Select]echo off setlocal enabledelayedexpansion for /f %%a in (a.txt) do ( if not !num! equ 3 (set line=!line! %%a) ELSE ( set num=0 echo !line! >>log.txt set line=%%a ) set /a num+=1 ) echo %line% >>log.txt pause Quote from: devcom on July 02, 2009, 06:25:37 AM Code: [Select]echo off Thank you very much. It's working fine. Problem solved. |
|
| 1812. |
Solve : help in outputting HPGL file to com port? |
|
Answer» I am trying to output an HPGL file to a com port. |
|
| 1813. |
Solve : Null character as delim?? |
|
Answer» Win XP Home SP.3. Cmd.exe batch scripting. Replying to own post!!Now you know...although it would be cool if you COULD though... |
|
| 1814. |
Solve : my pc wont start? |
|
Answer» Hi |
|
| 1815. |
Solve : ftp.exe "Data connection created for directory listing"? |
|
Answer» Hi folks |
|
| 1816. |
Solve : Resolved--- How to make a Batch file to copy folders from variable source?? |
|
Answer» Hi, |
|
| 1817. |
Solve : Piping, FIND command?? |
|
Answer» IN a CMD window I type maybe this: I ended up using this. This appears to meet my needs at this time. Thanks for the other replies. I appropriate it. gh0std0g74 Still haven't taking the the time to really learn VBS, need to as I know it has a lot of power, but in the mean time usually when I ask a DOS question it is because the rest of the BATCH is already written and some function part of it isn't working the way I think it should or isn't working to my needs. THANK you by all means though for your VBS input as at some point I will be shifting my focus into this LANGUAGE. |
|
| 1818. |
Solve : help getting DOS to talk to XP with "net use"? |
|
Answer» Hi everyone, |
|
| 1819. |
Solve : Version of EXE?? |
|
Answer» I am completing a script that copies some directories off as a backup and writing a log at the same time. |
|
| 1820. |
Solve : Batch Help - delete unneccessary quoted messages in email conversation? |
|
Answer» Hi everyone,
|
|
| 1821. |
Solve : can you help me about using dos move command to move directory?? |
|
Answer» I want to use "move" command to move directory. |
|
| 1822. |
Solve : D.E.A.D V2 , Batch File Game? |
|
Answer» hey i got banned so i havent been here in a long TIME, but im assuming its lifted because i was alloud to register again, if it hasnt been can it please be? I wanted to advertise my new batch game, since ive gotten banned its improved greatly, Im going to post it here in a few minutes , this version has many improvements compared to 6 months ago and the last one i posted here, What it includes, -In Game Help Database -Game Items, Game Item Creator and inventory -New Functions, Get/Use/Inventory/Drop items -Sacrifice now works, your god will give you money for your sacrifice -8 New Temples, 3 Of them hide keys to access the main temple "gemini" -The temple of gemini, it includes two thrones one to allow CHANGES to all variables And the other to allow changes to all Variables in all open instances of the game at the same time. -Map, Area Directions -Many Bugs Fixed, -New Game Titles -Vastly Improved interface offering multiple display options and added information -Added ways to access hidden areas built in the beginning of the game -Added a "forge" where any item of any kind may be created to an area. -All Open Instances now communicate variables to eachother, further improving networking -Added new classes/choices of faith -Fixed the options bugs,back bugs, I have a running website for D.E.A.D , you can find it at odn.t35.com/dead The new version (the one with working items, will be released here first) and is currently not available on the webpage.Here are the files dead.cmd < -- the game deadinst.cmd < -- The game installer icreator.cmd < -- Item creator [attachment deleted by admin]Im also offering a source for the 7th version of realms of *censored*, realms of *censored* is the second era of my batch game(created prior to D.E.A.D), please contact me by email for this source Since i added interactive items to the game, item packs have become possible to write an item, use this tutorial: Using icreator.cmd Variable ITN, is the Name of the Item for example , ITN=Egg Variable ITV, is the Worth of the item, ITV=400 Variable ITA, is the Area the item should appear, ITA=RBB0001 copy con %v1%\i%itn% , Adds the commands to the item file, The item file is named i%ITN% CLS&echo +%itn%>>%v1%\v%ita% ,Adds the item to the Room file, Items are identified from this file by whatever has a + sign NEXT to them, if it doesnt contain the + sign the item wont be listed. echo %itn% %itv%>>%v1%\sacl , This adds the Item name and worth to the sacrifice value list , EG: egg 400 i%itn% is the commands to be processed by usage of the item in question, and can include anything so the above, will create an "egg thats worth $400 in area RBB0001 (The front entrance" Avoid two named items for the time being, Not exatly those that had the ban on got removed. But were did you find that game? Also, in aid of helping if I can. I created the game from scratch, well this version is built off other versions the first one was diablos batch game, the second was R.O.H and now its D.E.A.D if you want to help you can take the source, try to eliminate all the bugs and add as many new features as possible, dont worry about adding new areas yet i want to get the game features working first in a small area then expand on them, so there is less work updating the code , you can make your own version or help with MINE and if you need to know anything just ask thanksI cant say exatly if I would be able to or not. Not used to working with bat too much k , well if you want to i can help you I can explain a little right now, It works by setting a bunch of variables, like your name faith ect then travelling to an "area" and that is just a section of the batch file the area the continues to process a few types of files from the game folder, these files provide items/possible movements/users in the area/save file information/Current time information/chat files/ and any number of other files, so that the information in one instance of the game isnt contained to a single instance but instead all running instances of the game, for example opening dead.cmd twice, you can see and interact with both players, in order to save many lines of code all the areas loop through a master area, sectioned as :XILE , :Xile works as the BRAIN behind the game, and all the calculations/lines of code are placed there except a few that are placed in the "area", xile processes a number of variables and creates a number of files, every move you make to another "area" you are first sent to :XILE without knowing it, Moving is all done by file, in all areas you will see a line similar to these for /f "tokens=1*" %%a in (%v1%\v%rmid%) do if "%%a"=="%choice%" %%b for /f "tokens=1*" %%a in (%v1%\v) do if "%%a"=="%choice%" %%b the first line checks for Room options, the file v%rmid% is vROOMID, rmid is the area id for example, RBB0001 is the "main entrance" Inside the V%rmid% file, you will see something similar to this N goto 404040 n goto 404040 S Goto 4039030 s Goto 4039030 so in the area, when you type N or n it will be checked in this file, and the result will be sending you to a section called 404040, The second line is similar, except its only called v, the v file contains all the room commands, like sleep,say,load,save,quit,main ect and works in the same way. if you need to know anything else just ask, This is supposed to be fun ? ? ? lol you mean the game? I agree the game sucks right now, but creating it has been fun for me atleast expecially since its almost at the point now where i can use itself to create itself. It seems really cheazy, I could do one and java and it be better but I dont have a complier. Heres another update, With working enemys This is just the first step in adding game enemys, but i wanted to show you First of all the new enemys arnt yet added into the game, to use an enemy please follow these instructions 1)install the game 2)open a new instance of the game 3)in NT Command prompt open the folder with the ded3.cmd file in it 4)create a file in the game folder root:\ded , that looks like this: exit goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 goto RBB0008 goto RBB0002 goto RBB0006 goto RBB0005 goto RBB0007 goto RBB0003 goto RBB0010 goto RBB0009 5)save the file -palace_security.eaf 6)type ded3.cmd ENA -palace_security 42 ded3.cmd is the program name ENA is the variable that switches it to enemy mode -palace_security is the enemy name 42 is the number of lines in the enemy file, enemys are identified in the game as someone with a - in the start in their name, so for this reason ALL enemy files must start with a - the above enemy will walk around the main area patrolling it [attachment deleted by admin]When I get the chance I'll look at it.How Do I actually Get the Game there is no download link herefourm is a good bit old. Its not a download, its code to make one. |
|
| 1823. |
Solve : AMAZING!!! Batch File Challenge!? |
|
Answer» Hello! |
|
| 1824. |
Solve : delays in BAT file to enable telnet? |
|
Answer» Hi All |
|
| 1825. |
Solve : Unhide hidden folders in Vista? |
|
Answer» Whilst trying to reveal the \Appdata folder in WINDOWS Explorer, I ACCIDENTALLY hid my dads entire user folder named TONY (C:\USERS\Tony). |
|
| 1826. |
Solve : How can I generate drive volume to file name?? |
|
Answer» I am running a batch file that pipes info to a txt file. I want to be able to have the file name reflect the drive volume name I am pulling from. For example. I am pulling data from my d: I want the file name to be [D:"VolumeName"].txt. Can this be done, if so how? Thanks in advance.Code: [Select]echo off |
|
| 1827. |
Solve : Load / Link a .lnk file in .gnu file? |
|
Answer» HI FRIENDS, I am NEW to DOS batch commands. Hope you people will help me in solving my problem. I have a .gnu file. I have a .lnk[LNK] file which contains all .obj references. I want to include or link or load .lnk file into .gnu file. So that when executing, the object files will be referenced. PLEASE help me in solving it out. Regards, Raj.What is the linker's parameters? Or the Linker's name?Hi, Its a HIGHC compiler. Regards, Raj.Hi Friends, Please help me out. I am really struck in the start. Regards, Nag.Can you provide the parameters(Type HIGHC /? at the command prompt to provide Parameters)? |
|
| 1828. |
Solve : lerning how to do output? |
|
Answer» i have a PROGRAMS that saves it's information as editable files and i want to know how to output info to a txt file repeatably.one of the tasks i am trying to do is to output i want the values of %corrx%,%corry% and %corrz% to go up by a certain amount each time it loops until they reach a certain value Code: [Select]echo off set maxx=10 set maxy=35c set maxz=30 set addx=1 set addy=6 set addz=3 set skipx=0 set skipy=0 set skipz=0 :LOOP if not %skipx% equ 1 ( set /a corx+=%addx% ) if not %skipy% equ 1 ( set /a cory+=%addy% ) if not %skipz% equ 1 ( set /a corz+=%addz% ) if %corx% geq %maxx% set skipx=1 if %cory% geq %maxy% set skipy=1 if %corz% geq %maxz% set skipz=1 echo.X = %corx% Y = %cory% Z = %corz% if %skipx% equ 1 if %skipy% equ 1 if %skipz% equ 1 goto FIN goto LOOP :FIN pause output Code: [Select]X = 1 Y = 6 Z = 3 X = 2 Y = 12 Z = 6 X = 3 Y = 18 Z = 9 X = 4 Y = 24 Z = 12 X = 5 Y = 30 Z = 15 X = 6 Y = 36 Z = 18 X = 7 Y = 36 Z = 21 X = 8 Y = 36 Z = 24 X = 9 Y = 36 Z = 27 X = 10 Y = 36 Z = 30 Press any key to continue . . . post code here so we can see whats wrong |
|
| 1829. |
Solve : Batch file output in a text file ( errror not getting in a text file)? |
|
Answer» Hi, |
|
| 1830. |
Solve : Problems with FOR /F loop in XP.? |
|
Answer» The following batch file creates a text file and parses lines from it |
|
| 1831. |
Solve : batch file syntax copy, move rename? |
|
Answer» I have read several posts and I cannot FIND it. |
|
| 1832. |
Solve : Can this be done? |
|
Answer» Hi |
|
| 1833. |
Solve : Start up error after exiting from MS-DOS and restarting to windows 98 HELP!!!? |
|
Answer» So i shutdown windows and reboot in MS-DOS mode and i do whatever and i hit Ctrl-C and type exit to exit MS-DOS mode and it will restart windows 98. When i exit MS-DOS to windows 98 i get a blue screen that says: Invalid VxD dynamic LINK call from NWLINK (01) * 0000010F to device "0028", service 8000.your windows configuration is invalid. Dave - I think the OP means when he uses the Exit command to return to windows having finished in the Command shell. i don't think it's the RAm chip. when my ram chip was faulty my computer KEPT beeping on off on off I put the ram in diffrint places and it wont go back to windows plus it still saids expaned memory (EMS) support i tipe exit and win and it still wont go back to windows 98??? |
|
| 1834. |
Solve : how to create rasdial Batch file with redial?? |
|
Answer» i FORGOT to mension for what purpose i made it. i make it to dial internet connection. in simlpe "rasdial" there is no OPTION to redial so thats why i want to make a batch file which redial it until i connected to internet. i created a batch file with name connect.bat with following parameters ECHO OFF rasdial "connection" user password How can we again CALL connect.bat when error 678 or any other error happens. May I ask what the application is for? Will help better UNDERSTAND how to make this work for you possibly as for I have PLAYED in this area of Computer Telecommunications before with other projects of my own. Such as a project that called me when a problem happened and told me what the problem was. From this it looks like you are just trying to get connected with ISP maybe or another system modem to modem? Thinking you may be able to supress the echo output of the error message and test it for connected text output or other, and if other ( not matching a successful connection text output ) then goto beginning of batch to redial.Thanks for your consideration. now my problem is solved through a software named "reconnect" its a freeware and fulfill my purpose. [attachment deleted by admin]add this: if not errorlevel 0 (name of batchfile) |
|
| 1835. |
Solve : Copy command which merges several files tags the word SUB at the end? |
|
Answer» The command Thanks SO MUCH for your help !!! the "EOF marker" (ctrl-Z) is a holdover from CP/M; with CP/M, files could only be allocated in blocks the size of a DISK sector. Because of that, it was necessary to indicate where the data actually ended. To do this, programs padded off the unused space in the last sector of a file with EOF marks (Ctrl-Z). when they read the file, they would read until they found an EOF mark and then stop. DOS kept the convention only for convenience with porting CP/M applications, by tradition text files all end with an EOF mark, and copy honours this. Note that /B treats the data as binary data, and therefore copies all of it; the extra eof mark you see without the /B switch is copy treating it as a text file and appending the EOF marker as a sort of convenience to programs that read until an EOF marker rather then the real end of file. Also, note that using copy to append two files, as in "copy file1+file2 resultfile" will not work properly without the /b switch in some circumstances; for example, if you try to combine two files that are non-text files or contain EOF markers within the text. Copy only copies each file until it FINDS an EOF mark, and writes them to the new file.Thanks for sharing your knowledge!! I look forward to helping others too! |
|
| 1836. |
Solve : Is Everthing possible?? |
|
Answer» I need a software to write batch file with commands
You are not only Mad but also a Joker. C:\>ren /? Renames a file or files. RENAME [drive:][path]filename1 filename2. REN [drive:][path]filename1 filename2. Note that you cannot specify a new drive or path for your destination file. C:\>copy /? Copies one or more files to another location. COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. /D Allow the destination file to be created decrypted destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written CORRECTLY. /N Uses SHORT filename, if available, when copying a file with a non-8dot3 name. /Y Suppresses prompting to confirm you WANT to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script. To append files, specify a single file for destination, but multiple files for source (using WILDCARDS or file1+file2+file3 format). C:\>TMJ, search for Notepad++ on GOOGLE. It won't MAKE the files, per-say (no program will, who would make a scripting program, to automate the script-creation of another scripting program?!), but it will colour-code commands, etc. to make it easier. It also has a lot more features than notepad, so I suggest you try it. Thanks for your help all Of you (Specially Helpmeh) |
|
| 1837. |
Solve : Make command window wider? |
|
Answer» Is there any way to make the command WINDOW wider (within the batch file)? It currently displays 81 columns of text, but it would be nice if I can make it display 100 or so. I tried the mode command, but if I change either the line or cols option, it becomes longer (undesired) (even if I leave them as-is, but run the command, it gets longer). In fact... my thinkpad has mode con:lines=43 in it's autoexec. (50 doesn't work properly on it) And that takes me back... EGA text screen. Quote from: Salmon TROUT on January 31, 2010, 09:07:21 AM And that takes me back... EGA text screen. strange thing is, the video is 640x480x256, and should be ABLE to show 50 lines. Quote from: BC_Programmer on January 31, 2010, 09:18:39 AM strange thing is, the video is 640x480x256, and should be able to show 50 lines. Is it using the 90 X 43 VGA mode? Quote from: Salmon Trout on January 31, 2010, 09:24:13 AM Is it using the 90 x 43 VGA mode? I don't believe so, the command used was mode con:lines=43, I think that gives it 80x43. I cannot check now though since I have no way to turn the thing on until the AC Adapter I got off ebay arrives. |
|
| 1838. |
Solve : List Of Files With Batch? |
|
Answer» So Again Its Me You are MAD, joker!Thanks For The Compliment Quote from: Geek-9pm on January 29, 2010, 11:49:33 PM You don't need a batch file to do that.U didnt understood my Problem There Is Not Only 1 File There are Several Files in both the folders Once Again I WROTE MAD , COZ I AM Ha!Ha!Ha! You can do it by hand. Making a Batch file wold be if you need to do it over and over again every day forever. If it is a report you need to make once a month, do it by hand, You cget into the COMMAND prompt, CD to the directory you want. Give a DIR command. The you can do EDIT, MARK, COPY to get it to the clipboad. Noen Notepad. Paste and save. Do it again for the other directory. If you need the files in two columns side by side, there is a norther step that does that. I THINK you can do that in Word. This would work for up to about two or three hundred files in each directory. If you have over three hundred files, then yes, you should do it in a batch program. Quote from: Geek-9pm on January 30, 2010, 01:33:11 PM You can do it by hand. I think he does... OFTEN! Quote from: Salmon Trout on January 30, 2010, 05:30:15 PM I think he does... often!OH So he makes a batch file and takes a long lunch. Hey! invite us for lunch if we write the batch for you!geek, if he wants to do it by hand, he would not post here in the first PLACE , would he? OP , just do a dir on both directories and use redirection Code: [Select]eg dir /B E:\tmp E:\test > newfile.txt check dir /? for more options.GhostDog thanks for your help but the file are coming like this "Testfile1" (Temp Folder) "Testfile1" (Test Folder) ...... I Want to get it like this "Testfile1" "Testfile2" But I appreiciate your Help Are you making a list of files? Do you want the files listed in two columns so you can compare thim? Like this" Code: [Select] LIST OF FILES IN D:\test LIST OF FILES IN D:\temp D:\test\Sample-001 D:\temp\Sample-001 D:\test\Sample-002 D:\temp\Sample-002 D:\test\Sample-003 D:\temp\Sample-003 How much information in the list? Is then for a report that will be printed later? Is the purpose to compare the contents of both directories to see if a file is missing? Geek You are the Best! D:\test\Sample-001 D:\temp\Sample-001 D:\test\Sample-002 D:\temp\Sample-002 D:\test\Sample-003 D:\temp\Sample-003 example you gave is right... but the space between them should be just "one" like this "D:\test\Sample-001" "D:\temp\Sample-001" "D:\test\Sample-002" "D:\temp\Sample-002" "D:\test\Sample-003" "D:\temp\Sample-003" Quote from: the_mad_joker on January 30, 2010, 11:59:27 PM
Why? For me, i can not do it all in batch, but inside of dos. i will need the old dos QBASIC. Quote Here is the batch:The ABASIC program ListAB2C.BAS Quote OPEN "LISTA.TXT" FOR INPUT AS #1 EDIT. fixed typos. Quote from: Salmon Trout on January 31, 2010, 01:03:10 AM Why? So That There could be more data in one line Quote from: the_mad_joker on January 31, 2010, 01:15:51 AM So That There could be more data in one line But, like a piece of string, a line can be any length. |
|
| 1839. |
Solve : batch that searches for "Request" in output from ping? |
|
Answer» I have been having to reset network hardware to fix a VPN problem daily and was looking into a way to test for connectivity across the vpn and only when the vpn is down to reset hardware to fix the handshake problem between 2 sites. |
|
| 1840. |
Solve : batch copy information.? |
|
Answer» hi every 1 Code: [Select]copy *.* E:\Copy the information, not the files. Try this. Dir >dir.txt Open up dir.txt and find all the information that would have been printed on the screen. Quote from: Helpmeh on February 02, 2010, 07:22:23 AM Copy the information, not the files. When we copy the files, the information is inside the files. Rem_bc, the OP(original poster) needs the information and not just the file names. Quote from: BillRichardson on February 02, 2010, 08:05:05 AM When we copy the files, the information is inside the files. Rem_bc, the OP(original poster) needs the information and not just the file names.The OP asked for asked for a batch file that will capture the information provided from the dir command. Quote from: Helpmeh on February 02, 2010, 09:24:34 AM The OP asked for asked for a batch file that will capture the information provided from the dir command. Maybe should let Rem_bc, the original poster, decide what he needs? Quote from: BillRichardson on February 02, 2010, 12:44:22 PM Maybe should let Rem_bc, the original poster, decide what he needs?Maybe you should read. Quote The batch file can copy the information.The information is not in the files, it is in the dir command's output. Quote from: Helpmeh on February 02, 2010, 01:49:56 PM Maybe you should read. The information is not in the files, it is in the dir command's output. Ok guys. What i want is the batch file that can copy the information into a text file. *.txt please help......Your post is ambiguous. Quote The batch file can copy the information. Copy it where? What information? the dir command output? the files themselves? Please try to me more specific. Not certain why the wildcard is used in the output file name. Code: [Select]echo off dir "C:\Documents and Settings\User" > dir.txt If you want to see the output, add type dir.txt as the last line in the batch file. Reply #2 solved this problem. Quote from: Sidewinder on February 03, 2010, 06:37:03 AM Your post is ambiguous. Well well. Thanks A lot !! It works. So This Topic's Closed.This Topic Closed!!! Thanks To...... Sidewinder, Helpmeh. And my friends. Quote from: rem_bc on February 03, 2010, 05:36:01 PM This Topic Closed!!! Thanks To......No problem. I'm glad we can help. A mod may close this thread, but there's no real need. Mountains vs Molehills. "Making a mountain out of a molehill or over-reaction is to make too much of a minor issue. In cognitive psychology, this form of cognitive distortion is called magnification." http://en.wikipedia.org/wiki/Make_a_mountain_out_of_a_molehill |
|
| 1841. |
Solve : want to search a string including quotes in DOS? |
|
Answer» i want to find a string whcih is in quotes I want to find and CHANGE a string which is in quotes Code: [Select]rem ECHO off findstr "\"80\"" file1.txt findstr "80" quotefile.txt | sed 's/"//g' findstr "80" file1.txt | sed 's/"//g' Output: C:\batch>quotefind.bat C:\batch>findstr "\"80\"" file1.txt 1233"80"12345 C:\batch>findstr "80" quotefile.txt | sed 's/"//g' 12338012345 C:\batch>findstr "80" file1.txt | sed 's/"//g' 12338012345 C:\batch> Input: C:\batch>type file1.txt 1233"80"12345 C:\batch> _____________________________ C:\batch>type file1.txt 1233"80"12345 C:\batch>findstr 80 file1.txt 1233"80"12345 _______________________ C:\batch>grep 80 file1.txt File file1.txt: 1233"80"12345 C:\batch>grep "80" file1.txt File file1.txt: 1233"80"12345 C:\batch> |
|
| 1842. |
Solve : QBasic 4.5? |
|
Answer» Hello, sorry to barge in but could someone tell me what is QBasic 4.5? technically there is no QBASIC 4.5, it's actually called QuickBasic 4.5; QBasic is the version of the INTERPRETER included with DOS 5 and 6. anyway, QuickBasic /QBasic are for writing BASIC programs.writing BASIC programs like......? Quote from: comda on February 01, 2010, 06:41:41 PM writing BASIC programs like......? That question makes no sense.i was asking what kinds of programs can you write with QBasic?There are many sites that can help you with Qbasic. Just GOOGLE the word "Qbasic" and find lots. It is well suited for use in DOS for things like simple arcade games, text games, text file manipulation and basic math calculations. QB 4.5 was the last compiler that Microsoft did for Qbasic. As BC said, the term "Qqasic 4.5" is popular jargon, but the program was really QB.EXE and there was an earlier version that was called QBASIC.EXE. There is not much interest in QBASIC on this forum. Quickbasic versions up to 4.5 were an interpreter/compiler/IDE programming environment sold by Microsoft. Qbasic is a cut-down (cannot compile) version. Version 1.0 was shipped together with MS-DOS 5.0 and higher, as well as Windows 95, Windows NT 3.x, and Windows NT 4.0. IBM recompiled QBasic and included it in PC-DOS 5.x, as well as OS/2 2.0 onwards.[7] eComStation, descended from OS/2 code, includes QBasic 1.0. QBasic 1.1 is included with MS-DOS 6.x, and, without EDIT, in Windows 95, Windows 98 and Windows Me. |
|
| 1843. |
Solve : Copying subdirectories? |
|
Answer» I am trying to start in a parent directory lets say for example I want to start my .bat program in the C:\CMD directory. I would like to loop through all folders within that directory. Go inside each folder and if the folder name = x copy folder to a certain directory if foldername = y copy it to a different directory. I have been able to loop through the files in my example directory but I could never seem to get to the child directory. Post your complete batch file. We need see what you done and the ERROR report.This will give you a hint, Code: [Select]HELP FOR returns this FOR /D %variable IN (set) DO command [command-parameters] If set contains wildcards, then specifies to match against directory names INSTEAD of file names. Are you sure that you want to enter the directory at each step, when you know the name surely you then know what to do with it ?Ok this is what I am looking to do: I want to loop through every file in lets say the C:\CMD directory. Here are my folders within that directory: C:\CMD\Example1 C:\CMD\Example2 I want to open up each folder and see what folders are with in Example1 and Example 2. Lets say within Example1 directory there is a Test1 and Test2 folder. Within Example2 directory there is a Test1 and Test3 folder. I want to be able to loop through each folder in the C:\CMD directory, look within each folder. Then say if folder name = Test1 copy that directory to x location, if folder name = Test2 copy directory to y location and so forth. Below is a sample of what I wrote. But it always returns the Example folder names instead of the TEST folder names. FOR /D %%G IN ("*") DO cmd /c FOR /D %%F IN ("*") DO cmd %%C IN (*) DO IF %%G == "TEST1" xcopy /s %%G C:\copy\You code4 is hard to understand and it is not clear what you want to do. It is easier to follow if you can make in is steps . For example: DIR TEST? /b/s Does the command give you a list of files and path-names of interest Is so, we can work from there.? |
|
| 1844. |
Solve : Two bat similar and only one work fine. Why ?? |
|
Answer» SpyBot Search and Destroy.
Uninstall the spanish version and install the english version? Change the path and FOLDER names to english? Use German version? Install and run Malwarebytes' Anti-Malware? Download, install and run Malwarebytes' Anti-Malware http://www.malwarebytes.org/mbam.php Quote from: Esgrimidor on February 02, 2010, 09:10:30 AM the message The easiest SOLUTION would be to rename that directory to something else: e.g. Protect.It's not possible to rename. But the solution was copy the final folder to another place. In Protect goes many portable software about security. And many links to my program goldmine and others. Understood for the next time. Precisaly I was looking about using "ñ" in domains names. ..... Or you could try: Code: [Select]echo off echo se trata de automatizar spybot. que se abra. se actualice. se inmunice. analice problemas, los corriga y se cierre Subst P: "Y:\PORTABLES\Protección\Spybot" P: rem añado la ruta completa en fecha 02.02.2010 para ver si funciona ahora..... SpybotSDPortable.exe /autoupdate /autoclose SpybotSDPortable.exe /autoimmunize /autoclose SpybotSDPortable.exe /autocheck /autofix /autoclose Subst P: /DSorry, There should be a CD Y: before the last line. Quote Precisaly I was looking about using ..... http://www.idnnews.com/?p=5704 Quote from: oldun on February 02, 2010, 05:10:34 PM Sorry, I don't understand. Can you put the whole script ? Thanksss Code: [Select]Third bat : echo off echo se trata de automatizar spybot. que se abra. se actualice. se inmunice. analice problemas, los corriga y se cierre REM If P: is already in use, use another letter Subst P: "Y:\PORTABLES\Protección\Spybot" P: rem añado la ruta completa en fecha 02.02.2010 para ver si funciona ahora..... SpybotSDPortable.exe /autoupdate /autoclose SpybotSDPortable.exe /autoimmunize /autoclose SpybotSDPortable.exe /autocheck /autofix /autoclose CD %~d0 Subst P: /D echo echo off I try an will comment Best Regards |
|
| 1845. |
Solve : Msg out of Bat? |
|
Answer» How to make a message box out of batch? How to make a message box out of batch?Try looking at MSG /? (you may not have it) or net send /? Or even better, USE a vbs solution. It will have more functionality and be overall a better idea. Code: [Select]mshta vbscript:Execute("resizeTo 0,0:MsgBox ""Text"",0,""Title"":Close") Quote from: Prince_ on February 05, 2010, 06:13:34 PM Code: [Select]mshta vbscript:Execute("resizeTo 0,0:MsgBox ""Text"",0,""Title"":Close")( WORKS Perfectly) C:\>box.bat C:\>mshta vbscript:Execute("resizeTo 0,0:MsgBox ""Text"",0,""Title"":Close") mshta vbscript:Execute("resizeTo 0,0:MsgBox ""Text"",0,""Title"":Close") Also, you can change the zero (the one I bolded above) to get different icons: Exclamation mark: 48 Information (i in a bubble): 64 Critical (white x in red circle): 16 Also you can add 4096 to make the messagebox system modal. There are other values for changing the BUTTONS, but I cannot think of a simple way that could be used to bring that result BACK to the batch file. Code: [Select]mshta vbscript:Execute("resizeTo 0,0:MsgBox ""Text"",0,""Title"":Close") Thanks that this code work very good. It look so real. Thanks...... |
|
| 1846. |
Solve : DOS Batch delete/copy? |
|
Answer» Newbie here, trying to figure out something while others are on vacation. We have an hourly processes that generates a file every HOUR 24/7. Daily, a directory is created, 20040707, and hourly files are created xyz1.dat, xyz2.dat, xyz3.dat... and so on. We have a second PROCESS that WOULD send the last file created. Is it possible to have a batch file to CHANGE all the extensions to *.old, this way only one *.dat file is available? Secondly, if that is not possible, COULD I copy the last *.dat file created to another server, while deleting the previously copied *.dat? |
|
| 1847. |
Solve : File check and is available to be processed? |
|
Answer» I have the following CODE to check to see if a file exists and if it is available to be processed because it might be in the process of being copied once the job starts polling for the file. For some reason this code seems to null the file once it sees it being copied. |
|
| 1848. |
Solve : Exclude space as delimiter in a list? |
|
Answer» Eventually this BATCH file will expand to allow selection of creation of a range of subdirectories, however I've got to get the code correct first. 1. Use quotes around list items. Well that worked. Many thanks Salmon Trout. He Da MAN... A technical explanation, in case anyone is interested (might HELP some readers)? In a simple FOR loop, for %%V in (dataset) do... if dataset is a list, separated by standard delimiters (space, comma, semicolon) then each time around the loop %%V will hold, one after the other, each item in the list. Thus: for %%A in (1,2,3) do echo %%A for %%A in (1 2 3) do echo %%A for %%A in (1;2;3) do echo %%A will all output 1 2 3 Quotes around list items allow the item to contain standard delimiters, e.g. spaces. The quotes become part of the variable string. for %%A in ("1 2" "3,4" 5 6 7; do echo %%A "1 2" "3,4" 5 6 7 8 If you want to strip the quotes, then, in the loop, use a tilde (~) before the loop variable like so for %%A in ("1 2" "3,4" 5 6 7; do echo %%~A 1 2 3,4 5 6 7 8 and, of course, dataset can be a variable: set MyList="1 2" "3,4" 5 6 7;8 for %%A in (%MyList%) do echo %%A "1 2" "3,4" 5 6 7 8You can use a list separated by LINE endings: for %%A in ( "2010-11 FY" "2011-12 FY" "2012-13 FY" "2013-14 FY" "2014-15 FY" "2015-16 FY" "2016-17 FY" "2017-18 FY" "2018-19 FY" "2019-20 FY" ) do echo mkdir %%A |
|
| 1849. |
Solve : Disk partitions.....? |
|
Answer» I have a drive of only 2 GIGS. But the capacity of my pc is 19 gigs. I want to delete the drive of 2 gigs. And create one drive of the full 19 gigs. And after that ... i want toformat the drive and then install windows ME. Now... the thing is .... I dont know how to delete the drive of 2 gigs and REPLACE it with the 19 gigs. I know we have to do something with fdisk command. Can someone HELP me here? By the way, i am running under windows ME. ThanksHow to partitition your hardrive http://www.webtechgeek.com/How-to-Format-a-Hard-Drive.htm How to format your hard drive http://www.newlogic.co.uk/kbase/fdisk/page1.htm |
|
| 1850. |
Solve : Bad command or corrupt? |
|
Answer» When we boot up my husband pc it goes thru the usual things then a screen comes up and it says : |
|