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.
| 8451. |
Solve : How to create batch file to delete files from subdirectories? |
|
Answer» Hi,
Quote
AFTER Quote
Thanks for your response. I am using the DOS version that comes with Windows XP Pro SP2. I dont know why my computer is acting in this manner PASTING the command i executed in DOS: Quote E:\Shared\Test>dirCan you please help me out of this?this is very strange. I am also using XP Pro SP2. I would be surprised if this is a feature of XP Home. What happens when you type VER? Quote Really weird. The version is same, Quote E:\Shared\Test>ver Version of C:\WINDOWS\system32\cmd.exe is 5.1.2600.2180You could try asking in Google Groups in alt.msdos.batch.nt. That is where the real experts live. Thanks for giving me this information about google groups. I have posted the question and WAITING for the reply. I have the answer to why we had different results. The behaviour you experienced happens if you are using the FAT32 filesystem. It does not happen if you are using the NTFS filesystem. I tried the same operation on a FAT32 partition I have for use with Norton Ghost, and it happened just like you described. Quote
So, convert to NTFS for better, more predictable file name handling! Have you got some special reason for sticking with FAT32? Thanks a lot... i was loosing my sleep becoz of this I tried in NTFS file system, and u r rite.. it works fine. Actually the system where i need to run this batch file is NTFS(luckly) I was trying it out in my system which was UNFORTUNATELY FAT32. But that was really a good piece of knowledge. Again thanks a lot!!if you had to do this on FAT32 you would have to use some batch tricks to filter out all the .tmpl etc extensions. An INTERESTING little project perhaps... but not tonight. |
|
| 8452. |
Solve : Backup Batch Problem? |
|
Answer» Hi all, |
|
| 8453. |
Solve : add date to file that is previous saturday?? |
|
Answer» I would like to rename a file, but I don't want it to have today's DATE, I want the date to be WHATEVER the previous saturday was. For example, I want the file to have the name file.011307 which was Saturday's date. How can I do this? Thanks.Quote I would like to rename a file, but I don't want it to have today's date, I want the date to be whatever the previous saturday was. For example, I want the file to have the name file.011307 which was Saturday's date. How can I do this? Thanks. Check your message box here. luvsun27, Try this: [edit]@echo off CALL:jdate jd SET /a jd=jd/7*7+5 CALL:jdate2date jd y m d echo.file.%m%%d%%y:~2% pause GOTO:EOF :jdate ... :jdate2date ... [/edit] Get the :jdate function from here http://www.dostips.com/DtCodeCmdLib.php#jdate Get the :jdate2date function from here http://www.dostips.com/DtCodeCmdLib.php#jdate2date DOS IT HELP? Why not do it the easy way. RESET the date in the computers clock. Rename the file. Set the clock to correct date.Quote Why not do it the easy way. Reset the date in the computers clock. Rename the file. Set the clock to correct date. You're right. Until I read your post, I was automatically thinking that it was a task that NEEDED to be repeated periodically, and that is not what the original poster said. I was prepared to swat a fly with an ELEPHANT gun. Sorry....I got someone to help me with a vb script to do this. And yes...this needs to be done weekly, so it's not feasible to change the clock all the time. I appreciate the help! |
|
| 8454. |
Solve : How to make a prank in DOS? |
|
Answer» This TYPE of POST should not be MADE on the forums.What about a LOCK, NATHAN? |
|
| 8455. |
Solve : ping computer if no responce do repair? |
|
Answer» I need to ping google.com, if i get a time out i need to have the bat FILE run all of the commands http://support.microsoft.com/kb/289256/en-us . i have been trying to figure out how to do this on my own. but with school starting it have been hard to find free time. |
|
| 8456. |
Solve : How do I get to DOS? Need to use Ghost image! Where is DOS?? |
|
Answer» Hello there... |
|
| 8457. |
Solve : Files= and buffers=? |
|
Answer» How do I CHANGE the value files for Files=0 Buffers=0 in Windows XP. I have a copy of QUICKEN that will not load WITHOUT these being changed to Files=50 and Buffers=10Read the file C:\WINDOWS\SYSTEM32\CONFIG.NT |
|
| 8458. |
Solve : multiple steps including FTP? |
|
Answer» I have a bunch of STEPS I want to do....FTP files, move them, RENAME them, FTP them again. I can do them using 4 steps (1st batch is FTP, 2nd batch is moving and deleting files, 3rd batch is FTP, and 4th batch is rename files). |
|
| 8459. |
Solve : can't boot from CD-ROM? |
|
Answer» I have an old Compaq Presario 7800 (P-III, 256 Mb RAM) which I am trying to renovate by installing a new HDD and Win-XP (It used to run Win98 but the HDD went bad, I still have the Win-98 upgrade CD but I no longer have the original Win-95 discs so the Win-98 upgrade does not find the "qualifying components" which allow an upgrade to proceed). Only one small problem remaining, when I boot, I get offered a choice of two OSs, both XP Pro. The first one is the good one I've just installed, the second one is the inoperable one created during one of my installation attempts yesterday. How do I get rid of the one I don't want ? You need to edit the c:\ boot.ini file so there is only 1 OS listed. If you paste what it contains we can advise what to do. Hi contrex. This is the boot.ini file: [boot loader] timeout=30 default=multi(0)disk(0)partition(1) \windows.0="Microsoft Windows XP Professional" /noexecute=optin /fastdetect default=multi(0)disk(0)partition(1) \windows="Microsoft Windows XP Professional" /noexecute=optin /fastdetect I guess I would need to delete one of those entries, but which one ? Alternatively, since it is a new installation with no settings, extra SOFTWARE or data, it would be simple enough just to re-format the partition and start over. What do you think ? JIf the first one you are offered is the one that works, the second one is the one to delete. The order in which they appear in the menu is the order they appear in boot.ini. If there is only one option in boot.ini, no menu will appear, the computer will just boot straight into the OS. Both options point to the same partition on the same disk, so you shouldn't have any files to delete. Great ! Job done. Thanks a lot for your help. (Great place this !) J |
|
| 8460. |
Solve : NEED DOS HELP? |
|
Answer» Windows XP operating system. I am trying to xcopy a set of files, etc. from one dir to another. But KEEP getting the error that the file already exists on the other dir. so it won't copy "Filename already exists" I do not want to delete these files on that dir, so what I want to do is IF the filename exists, I want to rename the file one th second dir. Seems straightforward, but I can't get itHI, Bell Try to CD (ChangeDirectory) in to the DIRECTORY you want to copy to and then DIR to see what your files are named, if they do EXIST there. Then do a RENAME or REN filename1 filename2 to change the name to what your heart desires. # 1 is the name it is, #2 is the name you choose. |
|
| 8461. |
Solve : Start unless file is already open?? |
|
Answer» i have a start command that i WANT to skip if the file is already running. Can this be done?One way shown below. I only execute the start command if it is not running elsewhere. |
|
| 8462. |
Solve : Batch File error handling using Net Use? |
|
Answer» I am creating a batch FILE that allows users to re-map their Home network share drive after a vpn connection has been made. Since the mapping is based on their profile, this won't push unless they logon while connected to our network. |
|
| 8463. |
Solve : A batch file that can lock the computer?? |
|
Answer» Is there a WAY to lock the computer through a batch file? But I need a way to unlock it too besides restarting.What do you mean by lock? Putting it on standby (if it is on standby, if RETURNS to the Log On menu without actually logging off your account, and you would still need to ENTER the PASSWORD if you have ONE)? |
|
| 8464. |
Solve : Capture the systems year, month, date, hours, mins, and second.? |
|
Answer» I would like to capture the systems year, month, date, hours, mins, and second as a parameter. As a NAME to rename one of my file. How can i do it .
Would you mind EXPLAIN the logic to me. sure, today is 17/08/2007 according to %date% if you typed echo %date:~0,2% it would echo only 17 echo %date:~0,3% would echo 17/ , if you typed echo %date:~2,3% it would echo /08,expand the variable after the letter with :~ the numbers 0,0 are line positions @set a=%date:~0,2%-%date:~3,2%-%date:~6,8%-%time:~1,1%-%time:~3,2%-%time:~6,2%-%time:~9,3% << here i used postions that wont show a \ ,so that when you use %A% as a file name. because \ might not allow it, i replaced them with dashes - |
|
| 8465. |
Solve : EvID4226Patch Script? |
|
Answer» I am looking to script the "patch" EvID4226Patch. So far all i can find to do this is the line (EvID4226Patch /L = ##) this works fine but it comes up and asks me if I am sure and I am not sure how to CODE the script to answer this or EVEN if it is possible? Any help would be great. |
|
| 8466. |
Solve : shimgvw.dll any parameters ?? |
|
Answer» Hi ! |
|
| 8467. |
Solve : How I can use space in name of files, addresses or folders in batch files?? |
|
Answer» Hi All |
|
| 8468. |
Solve : Taking files from one folder and putting them in another through dos/batch? |
|
Answer» I'm TRYING to create a batch file that will copy the FILES from one folder and paste them into another folder.. but I don't really know how to Code: [Select]copy /? copy "DIRECTORY TO COPY\*.*" "OUTPUT DIRECTORY" Or with xcopy: Quote xcopy "DIRECTORY TO COPY" "DIRECTORY TO COPY TO" /EThanks.. erm I don't know how my eyes skipped over copy... I looked through the help list at least 5 times. But thanks again.Yea, well it's there: Quote COLOR Sets the default CONSOLE foreground and background colors.Heh yeah I seen it just a few minutes ago, but I got it to run so thanks.No problem. If you need any more batch / command prompt advice we're glad to help. |
|
| 8469. |
Solve : Capture the content of the txt? |
|
Answer» i would like the capature some letter within the CONTENT of the txt file. @ECHO off That will only work if it's not homework.Quote from: cityjack on August 16, 2007, 11:40:43 PM i would like the capature some letter within the content of the txt file.show an actual SAMPLE of the txt file. also, is ABC always fixed?ABC is not fixed. the sample: 234,AB I would like to capture the 5th and 6th digit as parameter. |
|
| 8470. |
Solve : Some dos question? |
|
Answer» I would like to check the script error within the batch file. Do errorlevel = 0 mean not error, not equal 0 having error ? It's not "errorlevel=0" , it's "errorlevel 0". It can mean that, but not always! It means that the program returned an errorlevel, and the errorlevel was "0". DOS Errorlevel is a return code sent by a terminating program such as batch, exe, com or any applications. ERRORLEVELS are not a standard feature of every command. What the return code means is up to the programmer. However, most (not all) programmers agree that an errorlevel 0 means the command executed successfully, and an errorlevel 1 or higher usually spells trouble. But there may be some exceptions to this general rule. |
|
| 8471. |
Solve : Configure proxy using cmd.exe??? |
|
Answer» How do i CONFIGURE a proxy server in batch?that's a very VAGUE DESCRIPTION of your problem. What kind of proxy server you are using? give the forum more information.i just want to configure http proxys threw cmd.exe , for use in internet explorer.. i tryed ipconfig , an two others but no luck?? NEVERMIND , reg.exe does the trick |
|
| 8472. |
Solve : Batch File for AutoLogin & AutoBackup? |
|
Answer» Hi, |
|
| 8473. |
Solve : TXTs to XLS or TXT Merge? |
|
Answer» I'm tring to merge 4 txt files to 1 file (either a xls or txt) Its easy to do, but the output file list the files contents under each other. Is there dos code where by these files can be listed next to each other, EG xls into coloms and/or txt tab deliminated. Yea I wasn't able to figure out how to make this in Batch without being a max of 26 or having a bunch of variables.why use batch? there are many other excellent program languages around that fills in what batch lacks.I know.. The OP asked for batch so.. I know C# but I don't think you can use it for stuff like this..Quote from: DeltaSlaya on August 18, 2007, 06:06:11 PM I know.. The OP asked for batch so..i think that if you know and its easier to do, just post. This forum is for learning , isn't it.? even if OP cannot or don't know how to use C#. |
|
| 8474. |
Solve : User authentication and opening a program? |
|
Answer» Hello everyone, |
|
| 8475. |
Solve : VbsToEXE? |
|
Answer» The original program I suggested was an example, you can look for others. I guess as a last resort ghostdog could 'convert' it for you??hmm..not really. (unless i seen some effort). Haha, didn't think so, If he gave it to SOMEONE else maybe they'd have more luck using a program to convert it anyway?Well, I had fun and enjoyed the COMMUNITY here and did learn a couple things. Thank you all for that. The search continues. Rgds Selvan The Last BornsQuote from: ghostdog74 on August 18, 2007, 05:55:34 PM you should try to learn some vb instead of wasting time doing this. I said that too. Glad I'm not the only one. |
|
| 8476. |
Solve : Running dos with a text file.? |
|
Answer» My main goal atm is to start a batch FILE by starting a txt file. My main goal atm is to start a batch file by starting a txt file. Batch files are text files. If you want to be able to click a text file that you made and have it run, rename it. As in foo.txt renamed to foo.bat. If within foo.bat you want to run yet another batch file, you can do that too. No no no I want the .txt file to become a .batch file ONLY when I start the .txt file if you get what I mean. So if a friend of mine (WICH i SEND the .txt file to) opens it, it doesnt open .txt but it opens .bat. So basicly make a .bat file look LIKE a .txt file ^^. Thx in advance, -Hertebeest-I don't believe there is a way to do this. Each extension serves their own purpose. In your case .txt will open as a text file and .bat will of course open as a batch. You can't make a .bat file look like a .txt.Have a read through all of these. There is something in the 1,230,000 links that will be just right for you: http://www.google.com/search?hl=en&q=batch+file+tutorial >.> |
|
| 8477. |
Solve : kill a certain process? |
|
Answer» I have 2 batch scripts and i need when run ONE of them, that it to kill the other one that can't be otherwise closed. |
|
| 8478. |
Solve : Copy to new drive? |
|
Answer» Okay i CANT figure this one out. I want to copy the contents of a folder to a folder on my psp and then delete what has been COPIED. Basicaly i want it moved from the psp folder on my desktop to the music folder on my psp. But i dont want to specify what is to be copied. I just want all the files moved to the PSPCopy "E:\foldername" |
|
| 8479. |
Solve : Edit.? |
|
Answer» Edit.On which os do you WORK? Do you want that something starts up with your pc trough an edit in the registry made by a batch file? |
|
| 8480. |
Solve : Uneditable batch file? |
|
Answer» Any WAY I could make it so when you right click on the batch file you can't click edit and see all the code to it?Sorry, but no, that isn't possible.Well you could convert it to exe with a batch to executable converter. Though then technically it's no LONGER a batch file and doesn't fit your specifications..Making it into an exe was what I was looking for, I googled it and got what I WANTED. Thanks.Quote Making it into an exe was what I was looking for, I googled it and got what I wanted. Thanks. This isn't what you stated you wanted to do in the FIRST place...Well it didn't really matter if it was a .exe file or a .bat file, I just wanted my program's code to be HIDDEN from other users. |
|
| 8481. |
Solve : LOG file creation? |
|
Answer» HI ALL, I wanted to log the FTP status in a log FILE, for this i have created ONE script file which contains msdos commands and a batch file which contains FTP commant to execute the script file.But how can I create a log file for status USING either FTP ot ms dos commands or HELP me out nay other work arounds .thanks Ram |
|
| 8482. |
Solve : txtsetup.sif status 14 is corrupt or is missing? |
|
Answer» How can I fix this problem?Welcome to the CH forums. |
|
| 8483. |
Solve : need help to create simple loop? |
|
Answer» Hello |
|
| 8484. |
Solve : opening the file with a space? |
|
Answer» I have the following code and it works fine until the very last line |
|
| 8485. |
Solve : How to get HDD ID with a batch file?? |
|
Answer» Hi ! @echo offI've found a way to control another unique number at last. Thank you all for your help. Osman well, then you should say "serial number" and not "ID". Code: [Select]Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") For Each drives In objFSO.Drives If drives.DriveLetter = "C" Then WScript.Echo "Serial number is ", drives.SerialNumber END If Next output: Code: [Select]Serial number is 202343032 |
|
| 8486. |
Solve : Finding and formatting the time of a file creation? |
|
Answer» Hi All. |
|
| 8487. |
Solve : Looking for Ports? |
|
Answer» Does anyone KNOW of a command or otherwise that would enable me to scan all ports looking for one that is "listening" on my proxy server? I need to find one to download throughThat doesn't sound like something you're supposed/allowed to do.I'm at a boarding hostel that uses the school (seperate enitity) system, the blocks on the server ie MySpace, Bebo, Hotmail, etc are in order to stop the Day School students from using the computers for anything other than work but seeing as though I'm at the hostel I need to be able to do things; keep in touch with parents, download assignments, exemplars etc. I already use browsing proxies to overcome the problem of no emails, I just need to find a way of setting my explorer's download port to be an available one, so I can use my COMPUTER just as any day school student would whilst at home. |
|
| 8488. |
Solve : Multiline Batch Files? |
|
Answer» Hey guys, just a quick question, how do you do more than one line in a batch FILE (i.e. one command after another etc.) I just got no idea. ThanksWhat exactly is it your trying to do? Usually you can just do something like this...And it will work fine. |
|
| 8489. |
Solve : How to control if a folder is open ?? |
|
Answer» Hi ! |
|
| 8490. |
Solve : Change date format? |
|
Answer» HI, I'am writeing my application date to txtpad using a batch program.the application date looks for example 01012006.is there a way to change 01012006 to 01-01-2006? Regs, JeriThis is one of the those questions where the OS plays an important role. Since you failed to mention yours I can only guess WHETHER this will work or not: Code: [Select]SET dt=01012006 set editdt=%dt:~0,2%-%dt:~2,2%-%dt:~4,4% echo %editdt% Good LUCK. Note: Not sure if your date is mmddyyyy or ddmmyyyy, but you can set dt to any date provided you use the same format.Thanks for your help. Is there a way to change the date without assigning into a variable.for example notepad will only contain 01012006.is there a way to change 01012006 to 01-01-2006.Appricate your help. Regs, Jeri.I admit I'm confused. Notepad is an editor; can you not simply edit the date to whatever format you want? If you want to use a batch file, you might be able to write a search and replace and eliminate Notepad altogether. Is this date always 01012006 or are we talking about the current date? 8-)Check the options for Regional settings in control panel. |
|
| 8491. |
Solve : Need help in writing Batch file for moving files? |
|
Answer» Hi Experts, |
|
| 8492. |
Solve : Batch file ping test how to export results ? ?? |
|
Answer» Quote @ECHO off That should WORK! |
|
| 8493. |
Solve : indentifying latest file from its name(contains timestamp) and renaming it.? |
|
Answer» Hi , @ECHO off Somthin like that? |
|
| 8494. |
Solve : Log in to a ftp server using a batch file? |
|
Answer» Can any one please help me to login to a FTP server using a batch file and also in a telnet server please reply to my email id [emailprotected] i cannot give my user name in the field can you please help me please give me a "Test" file with commands No, posting once would have been enough. Why don't you go spam somewhere else?depending in the ftp server you're trying to CONNECT to and if you are behind a firewall, you could run into a lot of issues but here is a simple way of doing it create a batch file ftptest.bat and put this command in it "ftp -s: test1.txt" then create a text file called test1.txt and put these commands in it(note: single quotes imply values you need to insert) " open 'ipaddress of ftp server' 'username' 'password' bin mget 'name of file or files' close " and when you're done stop spammingHae thanks a lot yea right ill try thisYou will need to open the Telnet to do this, otherwise the commands are useless. they are not commands without using TelnetI am trying to do a similar thing, except I am using telnet instead of ftp. I can't get it to work. my batch file: telnet < telnet-SMTP.txt my telnet-SMTP.txt file: open smtp.comcast.net 25 HELO comcast.net MAIL FROM:<[emailprotected]> RCPT TO:<[emailprotected]> DATA Subject:my test message From: [emailprotected] To: [emailprotected] hello from user1. QUITwindows telnet client is not really meant for scripting telnet. I guess I was naive in assuming that ftp and telnet were simply black-box programs that wrote output and read input from a terminal (or DOS window). If one could predict the exact sequence of input/output values, then the INTERACTION could be programmed in a script. You are stating that ftp was programmed in a special way to allow this to HAPPEN, whereas telnet was not. That gives rise the question "How does one write an interactive program (say in C) whose input/outputs CAN be scripted?" If this can be done, what would a typical script look like (with I/O redirection operators)? I am not being argumentative, I just want to understand this issue. Thanksthat's why there are better languages out there that has the capability to script telnet and ftp. eg Perl. check this for eg on FTP. Check this for EXAMPLE on telnet. |
|
| 8495. |
Solve : batch script help? |
|
Answer» i am writing a batch script to compare the time in logs with the system time to check if the process is getting delayed |
|
| 8496. |
Solve : Create directory if not already existing? |
|
Answer» Hi, What Operating System is this? Read the post, dude! Quote I am running the bat file in XP. The answer is... To be found on Google. Quote from: contrex on August 29, 2007, 04:50:15 AM Quote from: Carbon Dudeoxide on August 29, 2007, 04:00:48 AM« Last Edit: Today at 06:08:43 PM by di98mase »What Operating System is this? Must of edited it then. Last Edit: Today at 11:08:43 AM by di98mase Reply #1 on: Today at 11:00:48 AM by Dudeoxide Now I call that DOWNRIGHT sneaky. I'll edit my answer now I've SEEN that. Quote from: di98mase on August 29, 2007, 03:53:28 AM ... Have a look here . Experiment a bit, and let us know if that HELPED. |
|
| 8497. |
Solve : copy html from website? |
|
Answer» could i make a code that would copy a websites code into a FOLDER? i was thinking something like:Code: [Select]copy http://lightstormlabs.com C:/seth/html/but that wouldnt work for MEYOU need a way to display the source code in a COMMANDLINE, I don't know, maybe a command line program on firefox or something. Once you can do that it's all plain sailing from there.you can use wget. or use IE AUTOMATION. (vbscript) |
|
| 8498. |
Solve : use batch to do some decryption.? |
|
Answer» My case is: . |
|
| 8499. |
Solve : Copy Files to PC From a Camera That Doesn't Show Up as A Removable Drive on PC? |
|
Answer» Is there anyway with MS-DOS to Copy Files to the PC From a Digital Camera That Doesn't Show Up as A Removable DRIVE on a PC..?? |
|
| 8500. |
Solve : Redirecting output to both file and screen? |
|
Answer» Is it possible in DOS to print the output both in a file and stdout ? 1) search for the windows port of the tee command ..you know how to right? It is surprising that someone with a Unix type background does not know how to type "tee port NT" into Google. If they did they would have found (among others) Rob van der Woude's tee.bat, or the excellent blip project's package which includes tee.cmd. Mind you, we are assuming the OP actually meant "NT/W2k/XP/Vista command line" when they typed "DOS"... not always a safe assumption... maybe they will clarify? For "real" MS-DOS there is FORK.COM, again findable with Google (it's in FORK33.ZIP)Quote Mind you, we are assuming the OP actually meant "NT/W2k/XP/Vista command line" when they typed "DOS"... not always a safe assumption... maybe they will clarify?hmm...how about another sub forum called Disk Operating System (DOS).? is it warranted? Well, to me there is MS-DOS and there is NT command prompt. They are different things, and I don't like to see them mixed up. Because the NT command language has many of the same commands as MS-DOS, with (sometimes, but not always) the same syntax, many people confuse them, or assume that the command window you get in 2K/XP/Vista is actually called "DOS". I guess the problem is most acute among the "GUI generation" who are aged under about 25, who have grown up with Windows of one form or another. I personally FEEL that this forum has made a rod for its own back by not SUFFICIENTLY distinguishing between them. I can imagine that ANSWERING questions that ask about "DOS" with a purely MS-DOS based answer would pretty soon ram the point home... |
|