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.
| 8951. |
Solve : undocumented commands? |
|
Answer» these are the ones i know about in vista.. |
|
| 8952. |
Solve : accessing a direcory whose name is digits only? |
|
Answer» i USE the COMMAND in windows server 2003 (not the cmd, the COMMAND) |
|
| 8953. |
Solve : Are these task possible in(or with) batch files? |
|
Answer» can you run a batch file once radomly in one hour timespan? can the batch file go lookup and parse an xml file in a network share? can the same batch file be minimized in the taskbar at all time (i.e like other applications)? can the batch file show an alert message if the xml file contain certain word(little alert like msn messenger show friends come online)? and if someone click the alert, another application is launched? what language or technology do you suppose I use to achieve all these in the quickest and easiest possible way. I tried flash but couldn't minimize icon in taskbar. Any pointer. Sincerely1. can you run a batch file once radomly in one hour timespan? If the file was being ran randomly it wouldn't be running each hour. Maybe I don't understand the question. But you could run a batch file every hour. 2. can the batch file go lookup and parse an xml file in a network share? Depends on how or what your parsing. Could be possible. But for the most part this is not what batch files are for. 3. can the same batch file be minimized in the taskbar at all time (i.e like other applications)? Yes. 4. can the batch file show an alert message if the xml file contain certain word(little alert like msn messenger show friends come online)? and if someone click the alert, another application is launched? Again batch files are not really meant for parsing data. It may be possible, but not likely. As far as sending an alert or other message it would all really depend if the alert could be DONE through a command prompt. However, more than likely not possible with a batch file unless you had another program running from the command line that interfaced with MSN. what language or technology do you suppose I use to achieve all these in the quickest and easiest possible way. I tried flash but couldn't minimize icon in taskbar. Any pointer. I'd suggest a more advanced programming language. For SOMETHING like what you mentioned above I'd suggest a Perl script. For this to work though you'd need to GET the free Perl interpreter for Windows. However, Perl is one of the best if not the best for parsing text and could handle more advanced situations such as sending alerts. Thank you kindly. By randomly in an hour I meant to say, RANDOM interval without going over an hour, just like dices, random occurance but never over 6. Anyway, I don't know how to do these tasks in Perl (just yet). To show Alerts I probably need to do Perl GUI stuff? Anyway thanks again.In NT (NT/2K/XP/Vista) batch you could at each hour (ie when clock says HH:00) produce 6 random numbers between 1 and 59, then SCHEDULE a batch to run at hh:MM where each MM is one of the numbers thus produced. |
|
| 8954. |
Solve : Time plus 1? |
|
Answer» I have XP to let you know |
|
| 8955. |
Solve : How to get onto a command prompt when your admin won't give pass to access it.? |
|
Answer» How to get onto a COMMAND prompt when your admin won't give pass to access it? my administrator has locked command prompt on all users except for his. He won't give anyone it. The only way |
|
| 8956. |
Solve : FIND A FILE? |
|
Answer» Hi set /a c=%b%-20 <<-time minus minutesmight fail if file time is say, 11:59am and current time is say, 12:01 ? correct me if i am wrongyea i see what you mean i dunno if this will WORK @ECHO OFF :DIM1 for /f "tokens=1*" %a in ('time /t') do set a=%a set b=%a:~0,2%:%a:~3,2% set f1=%b:~0,1% set f2=%b:~1,1% set f3=%b:~3,1% set f4=%b:~4,1% if '%f3%' == '7' set f3=1 if '%f3%' == '8' set f3=2 if '%f3%' == '9' set f3=3 if '%f1%' == '2' set f1=1 if '%f1%' == '3' set f1=1 if '%f1%' == '4' set f1=1 if '%f1%' == '5' set f1=1 if '%f1%' == '6' set f1=1 if '%f1%' == '7' set f1=1 if '%f1%' == '8' set f1=1 if '%f1%' == '9' set f1=1 set /a c=%b%-20 set d="%c:~0,2%:%a:~3,2%" dir *.txt /a >>%temp%\2 & CLS for /f "tokens=1*" %%a in ('findstr %d% %temp%\2') do echo %%a>>%temp%\3 for /f "tokens=1*" %%a in ('type %temp%\d') do SEND YOUR EMAIL :DIM2you would have to use cacl's as a command. CACL"s is a command that lets you view and modify files of your choice. Quote from: dos nerd on October 13, 2007, 11:15:27 PM you would have to use cacl's as a command. CACL"s is a command that lets you view and modify dos nerd, COULD you please ONLY post when BOTH these things are true:- a. You understand the question b. You know the answer (You're getting noticed.) Dear All Thanks for your support I am testing the script , if any problem i let you know tks rds reposDear All I try all the scripts it is not working , i i did not try the vb script due to i dont have vb install in my machine pls let me know which script i need to try for thisQuote from: raj_repos on October 17, 2007, 09:36:32 PM Dear Allwhich OS you using, vb COMES native with Windows. Unless you are using pure DOSHI I am using windows xp rdsany update pls rds |
|
| 8957. |
Solve : Getting Path in DOS Command For syntax? |
|
Answer» In the following code: |
|
| 8958. |
Solve : Question re: FOR loop? |
|
Answer» I'm trying to use a FOR loop to parse 4 comma-delimited values, some of which may be null values. The syntax I'm using isn't interpretting the null values as I'd like. Any suggestions? (I need to do this in a batch file.) but unless someone else comes up with another suggestionuse a better language than batch for parsing files. |
|
| 8959. |
Solve : BAT file and problem with parameters? |
|
Answer» Hello |
|
| 8960. |
Solve : Command to know the file system size? |
|
Answer» Hi, |
|
| 8961. |
Solve : commands? |
|
Answer» how do u send message to computer?If the computers are in the same room, you can write the message on a piece of paper and fold it up as a little paper airplane. Then you just throw it in the direction of the computer you want to send a message to. |
|
| 8962. |
Solve : full screen? |
|
Answer» I know you can MAKE the DOS PROMPT full SCREEN by pressing alt+enter, but is it possible to do it in a batch file?Welcome to the CH forums. |
|
| 8963. |
Solve : Add a batch file (.bat) at windows startup?? |
|
Answer» i want to add a batch file when windows start....i mean that batch file will run every TIME windows start......i do not want to use scheduled task by windows....is there any way to PERFORM this job with dos command. |
|
| 8964. |
Solve : question on creating a batch file? |
|
Answer» dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago? Try to give more information and be a bit mor specific. What?... As contrex said... QUOTE from: contrex on October 14, 2007, 12:36:17 AM dos nerd, why are you writing a nonsensical meaningless misleading answer to a thread that died 4 months ago?dos nerd, (Hi everybody from Barcelona!) You are wasting everybody´s time with your nonsense. Eres pendejo. |
|
| 8965. |
Solve : How to return to the original drive/path?? |
|
Answer» I'd like to be able to return to the user's current drive/PATH before my batch file ends. I couldn't find a SYSTEM variable which does this, so is this done by SETTING two VARS for the drive and path? How would this be done? |
|
| 8966. |
Solve : Not a .lnk shortcut? Old DOS question? |
|
Answer» I have a shortcut from the TYPING program "Timed Writing". It is not a normal shortcut as it is 3kb instead of 1kb. It also can't be deleted via command line using the extension ".LNK" as normal shortcuts. And under description, it says "Shortcut to MS-DOS program" not just shortcut. |
|
| 8967. |
Solve : Substrings of tokens? |
|
Answer» I am trying to use DOS to filter lines from one file to another. I only want the c:\ records in the new output file. Code: [Select]findstr /I "c:\\" file > newfile Thank you. It works but my actual problem is a little more comlpex. I could Pipe a few of these together to do more tuning I guess. I was hoping for a more programmatic option so it could be customized to the situation. |
|
| 8968. |
Solve : how to search for a folder in dos? |
|
Answer» Hi experts, @echo off ??Have to use dir dir ... or assocset a=%cd:~0,1% dir %a%:*.* /a:d /b /s |
|
| 8969. |
Solve : Tiling running processes (Windows)? |
|
Answer» Does anyone know how to write a batch FILE that will cause windows to tile the running windows?You could try an EXTERNAL command, like CMDOWi ALREADY POSTED this but admin DELETED my posts looks like |
|
| 8970. |
Solve : how do i enable passing 'yes' option? |
|
Answer» me from INDIA...i dnt think i need any angelina jolly or brad PITT to identify INDIA... |
|
| 8971. |
Solve : restarting IIS service using batch script? |
|
Answer» I need to restart IIS Admin Service using batch script.(this csript will be run as a job where no manual INTERVENTION is needed) |
|
| 8972. |
Solve : MSDOS 6.2.2 disks? |
|
Answer» HI Everyone, I have an old computer that runs on dos 6.2.2 and I need to re-install the O/S. Does anyone have the 3 disks that you can email me or know of a website that I can download the disks? I would appreciate it very much. Thanks a lot in advance. SapphireQuote from: sapphireml on October 15, 2007, 08:41:11 AM Hi Everyone, MS-DOS 6.22 was never released by Microsoft, therefore it cannot legally be SHARED via email or website. Here is one place, with several options for you to purchase it: Link Another link Maybe someone else will post some other ideas for you, ... INEXPENSIVE places to purchase it. Quote from: sapphireml on October 15, 2007, 08:41:11 AM Hi Everyone, You didn't mention what the computer would be used for, after the re-install. Windows 3.1, for example. If it is to be WIN 3.1, then this next idea to consider won't work. There are free "dos" operating systems out there. You'd have to read about them to decide if they will do what you want though. FreeDos Some reading, for what it is worth, on FreeDos OpenDos Some reading on Open Dos This is a computer belonging to a customer whom I am providing technical support for. Need to re-install everything because the hard disk has crashed. Thanks.Quote from: sapphireml on October 15, 2007, 09:41:21 AM This is a computer belonging to a customer whom I am providing technical support for. Then you'll have to do it legit, and recommend that the customer purchase a copy of 6.22. Quote Need to re-install everything because the hard disk has crashed. Thanks. umm.. ... we don't know what "everything" entails. But that is ok. You are right. Anyway, I think I just need the FILES in disk 2 because disks 1 and 3 seem to be readable. Thanks. |
|
| 8973. |
Solve : ms-dos? |
|
Answer» How to change fonts or BACKGROUNDS on Command prompt Sets the default console foreground and BACKGROUND colors. Please try a more definitive name to your topic next time... |
|
| 8974. |
Solve : Listing Original File Creation Dates? |
|
Answer» Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on an EXTERNAL storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be VIEWED, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated. Would anyone being willing to help a DOS novice with a problem. I am trying to produce a list of all files on an external storage device based upon the file creation date prior to being copied to the drive. The creation date for most if not all files on the drive is the date that the files were copied to the drive. Is there a field that can be viewed, which shows the original creation date for a given file? Additionally, is there a method to using the DIR command to list all files created after or before a given date, that happen to be archived in multiple subdirectories on the drive? Any assistance would be greatly appreciated.problem with DIR is that its not able to show you the date creation till the seconds LEVEL...i have seen how it can be done in pure batch, but its tedious. if you don't mind vbscript...here's one Code: [Select]On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") strFolder="c:\temp" 'you can pass in as script argument too... Set wshArgs = WScript.Arguments If wshArgs(0) = "" Or wshArgs(1) = " " Then WScript.Echo "Usage: cscript /nologo " & Wscript.ScriptName & " "& """MM-DD-YYYY HH-MM-SS""" & " -b(efore)|-a(fter)" WScript.Quit(1) End If dateToCheck = wshArgs(0) WScript.Echo dateToCheck b4after = wshArgs(1) Sub DoWalk(sDir) Set objFolder = objFSO.GetFolder(sDir) For Each Files In objFolder.Files numDays = DateDiff("d", Files.DateCreated , dateToCheck) If Right(b4after,1) = "a" And numDays < 0 then WScript.Echo Files, Files.DateCreated ElseIf Right(b4after,1) = "b" And numDays > 0 Then WScript.Echo Files, Files.DateCreated End If Next For Each oDir in objFolder.SubFolders DoWalk oDir.Path Next End Sub DoWalk strFolder usage: save as myscript.vbs, and on command line, TYPE cscript /nologo myscript.vbs. |
|
| 8975. |
Solve : Creating Batch File? |
|
Answer» HI, I would like to know if their is a way to create a Batch File (or anything else) That will start a App1.exe Once the App1.exe finished (closed) The App2.exe Start. Once the App2.exe finished (closed) The App3.exe Start...... Any IDEA?start /WAIT "" "App1.exe" start /WAIT "" "App2.exe" etc Thank you man. Your the Best You should put in "test" for the second step but I forgot my the first step. Instructions are on thiswebsite GET it from therer if you want. Quote from: dos NERD on OCTOBER 15, 2007, 12:07:43 AM You should put in "test" for the second step but I forgot my the first step. dos nerd, are you for real? |
|
| 8976. |
Solve : The Open File - Security Warning dialog box is displayed when you try to silentl? |
|
Answer» Hi, |
|
| 8977. |
Solve : Copying a file to multiple machines? |
|
Answer» Hello everyone. I am trying to create a BAT file that will COPY a file over to MUTIPLE machines on our network. I have all the machines on our network exported to a txt file. I have the file I need to copy to these machines in the root of my c partition. I need to know what the DOS command would be to copy this file down to all the machines in this txt file. Hello everyone. I am trying to create a bat file that will copy a file over to mutiple machines on our network. I have all the machines on our network exported to a txt file. I have the file I need to copy to these machines in the root of my c partition. I need to know what the DOS command would be to copy this file down to all the machines in this txt file. I think you could get a USB with enough bites to copy and then create a shortcut to another computer. dos nerd, could you please ONLY post when BOTH these things are true:- a. You understand the question b. You know the answer (You're getting noticed.) |
|
| 8978. |
Solve : Making text appear HELP!!!? |
|
Answer» I want the DOS WINDOW to COME up and type @echo off Is that about it?You WOULD have to make sur that your MS-DOS background is not the same colour as your font. Then if that doesn't work just press "DIR ..." lots of times. That might work.] From ??dos nerd, could you please ONLY post when BOTH these things are true:- a. You UNDERSTAND the question b. You know the answer (You're getting noticed.) |
|
| 8979. |
Solve : How to organize files at times when using "AT" as a command?? |
|
Answer» I REALLY NEED itMaybe you should give more details of what you want to do, if this is EVEN a genuine QUESTION. |
|
| 8980. |
Solve : How to pass a comma delimited string to the DOS batch file?? |
|
Answer» I want to pass a string contains the comma, such as "A,B,C", to the DOS batch file. I want the whole string to be treated as ONE, not THREE separated parameters, how can I accomplish this? here is the example: Quote > type test.bat What I expect is: test A,B,C the batch file will call that external program in the format of external_program /para:"A,B,C"Quote from: OldJack on October 13, 2007, 10:38:32 AM here is the example: OK I'm with you now. First add quotes test "a,b,c" Then remove them with the ~ modifier in the batch file if you need to or just LEAVE them. Quote Excellent! Thanks. Quote
|
|
| 8981. |
Solve : merge files with COPY? |
|
Answer» Is there any easy way to merge many files into one file using the COPY command without naming each file? i think i found it. it seems to be copying the final outfile into outfile again. I am pretty SURE - not 100% -that if it isn't there when you run the command it won't be seen by the "*.txt". You may be leaving outfile there after running the command so the next time you run it, it gets found by "*.txt". You could either give the merged file a different extension or have it in a different folder. Quote is it possible to apply the same logic to a CRLF dos program that i run. rather than typing every file name? Try this for %a in ("*.txt") do crlf %a 182 /c /s2 /ff%a /d Quote any recommended books i can read on dos to learn this? I just used online guides but you could check your library. DOS the Easy Way by Everett Murdock Ph.D. isn't too bad. contrex - thank you, you've been very helpful. one last question I hope - i have been running these in a .bat file in the same folder where the files are located. how do you i specify the folder (c:\data\etc) in the commands you've provided? thanks, BenQuote from: benm on October 11, 2007, 07:52:33 AM one last question I hope - i have been running these in a .bat file in the same folder where the files are located. how do you i specify the folder (c:\data\etc) in the commands you've provided? Something like this... You put it in front of the filespec for the source files for %a in ("C:\data\apple\orange\*.txt") do crlf %a 182 /c /s2 /ff%a /dff%a /d I presume your crlf program will TAKE path names in its parameters so you'd put the path in the appropriate place for %a in ("C:\data files\path has spaces\apple\orange\*.txt") do crlf %%a 182 /c /s2 /"C:\data\pear\so does this one\banana\ff%%a" /d note where I use quotes In a batch you can open out the loop using brackets which can make it easier to visualise what's going on. You can have multiple lines. For example for %%a in ("C:\data files\path has spaces\apple\orange\*.txt") do ( echo source file is %%a echo target file is C:\data\pear\so does this one\banana\ff%%a crlf %%a 182 /c /s2 /"C:\data\pear\so does this one\banana\ff%%a" /d ) ok, let's SEE if i can explain what's happening. i tried this in the folder where the files are located for %%a in ("*.txt") do crlf %%a 182 /c /s2 /ff%%a /d the crlf program did work but it seems to be grabbing the first file it processed and processing it again. so if i started with 3 input files, i get 4 output files - 3 starting with f and one starting with ff. next, i tried specifying where the files were located using: for %%a in ("F:\ZIP4\DOS\*.txt") do crlf %%a 182 /c /s2 /"F:\ZIP4\DOS\ff%%a" /d this is the message i got: Failure in opeing working file: :\ZIP4\DOS\ffF:\ZIP4\DOS\500.txt any thoughts? with a little more experimenting, this is what i got to work for %%a in ("F:\ZIP4\RAW\IA\*.txt") do crlf %%a 182 /c /s2 /d for %%a in ("F:\ZIP4\RAW\IA\*.wrk") do type %%a >> F:\ZIP4\RAW\IA\iaprod.txt move F:\ZIP4\RAW\IA\iaprod.txt F:\ZIP4\PROD del F:\ZIP4\RAW\IA\*.wrk the crlf program outputs the file with a .wrk extension. and renaming the output file to .txt when the input files are .wrk avoids the the file being doubled up in the end. thank you very much for your help, contrex. |
|
| 8982. |
Solve : List all files except .lst files? |
|
Answer» Is there a SIMPLE way of doing this in DOS?Pipe the output of DIR through FIND.EXE thus:- might be better to USE findstr with "$" eg dir /B | findstr /I /V ".lst$" just in case.just in case what? (I'm curious) Quote from: contrex on October 12, 2007, 10:26:51 AM just in case what? (I'm curious)just in case some file's name might be "important.lsting" ? without trailing $ sign, it will be OMITTED from the results.Oh right. I was just answering the original question Quote List all files except .lst files Maybe the OP should specify what he/she wants |
|
| 8983. |
Solve : how to trim the last 4 characters from file? |
|
Answer» I've been using a for loop to parse out info from a dir > list.lst file to build up a where clause. |
|
| 8984. |
Solve : DOS Command for creating text file? |
|
Answer» Do you happen to know what the DOS command is to make a text file that would CONTAIN a file listing of all files that had a certain extension (like DLL)?try |
|
| 8985. |
Solve : File Copy/Backup Datewise. Batch Help !!!? |
|
Answer» I'm using a batch file to backup data from a PC to a server. The batch file is using Robocopy as the command to copy the folders/files. |
|
| 8986. |
Solve : Creation of database in MSSQL using Batch scritpt? |
|
Answer» I want to crate database in MSSQL using Batch script I used it by TWO WAYS.
This line is the problem :process osql -E -S %ServerName% -n -i %1 >> Result.txt This whole line is treated as a LABEL, move the osql to the line below .... you will almost certainly have a 0 byte file called Result.txt Graham |
|
| 8987. |
Solve : how to delete files with certain string in them?? |
|
Answer» Hi, I am a new user with very limited DOS experience. On filenames with spaces in them it did not work. using quotes thus: del "%%a" is the standard way around that. Quote from: edgar on October 10, 2007, 06:05:33 PM If the file has a different suffix than .txt it did not work (I suppose thats why *txt is in the code) In fact, in the code as shown in your post, the wildcard search (*txt) will take place on all files whose name or extension ENDS in the three letters "txt", so it would work on all these files prices.txt process.etxt protetxt NOT just files whose extension is .txt - for that the wildcard filespec would be *.txt - see the dot? If you wanted to search all files, the wildcard filespec would be *.* |
|
| 8988. |
Solve : new user with registry problems? |
|
Answer» i was recently given an older dell computer, it has had windows 98 program put onto it. everything seemed to be going great TIL i tried to download yahoo instant messenger.thats when i got the file message. the window will pop up for instant messageing and i can TYPE a message and send it, but then i cant SEE what i have written or what anyone has written to me. i used the tips from your question and answer page to try to restore my registry and it didnt help. i dont really no very much about computers and have no IDEAL what to do next. when i click on yahoo messenger i get 2 different internet script error pages. |
|
| 8989. |
Solve : To check whether SQL Server is intalled.? |
|
Answer» Hi, All Hi, Allif you want to see whether its installed, you can go to Program files and search for its installation path. however, if you just want to check whether its up and running...a few ways 1) SQL server usually runs on port 1433. So using a combination of NETSTAT with options, findstr and using errorlevels, you can check whether its up 2) using the sc command , #hint: type sc /? to see how to query mssql service. 3) using command line mssql CLIENT like osql, isql. Try to connect to the server, if RETURNS error, then mssql is not up or not set up properly.... |
|
| 8990. |
Solve : a main batch file (see below) that will call and run 6 other batch files? |
|
Answer» My PC: Window XP pro. with SP2 One simple question, if the ERRORLEVEL is 0, what will happen to all labels? Answer: you need to rewrite that batch! It is my bed time here in England, I will look at this tomorrow but I will say a small thing about errorlevel Errorlevel can be between 255 and 1 for errors and 0 for success. It returns TRUE if the return code was equal to or higher than the specified errorlevel. This means most of the time we only need to check IF ERRORLEVEL 1 ... and this will return TRUE for every non-zero return code. Consider this code myprogram.exe IF ERRORLEVEL 1 goto bad echo myprogram.exe was successful! goto end :bad echo there was an error in myprogram.exe! :end echo end of batch If myprogram.exe returned an errorlevel of 1 (or more!) then the IF is satisfied and the batch interpreter (cmd.exe) jumps to the label. If myprogram.exe returned an errorlevel of 0 then the IF is NOT satisfied and the interpreter goes to the next line. Your code Quote call "C:\batchFiles\BW1\BW1_nightly_IS12.bat" > "C:\batchFiles\BW1\BW1_nightly_IS12_buildLog.txt" It will go to notify1 whether the errorlevel is 0 or >=1 (it is going there anyway!) thanks for your speedy reply. Am I on the right track? thank you very much, Betty call nightlyBuild1.bat IF ERRORLEVEL 1 goto bad1 echo nightlyBuild1.bat was successful! goto nightlyBuild2 :nightlyBuild2 call nightlyBuild2.bat IF ERRORLEVEL 1 goto bad2 echo nightlyBuild2.bat was successful! goto nightlyBuild3 :nightlyBuild3 call nightlyBuild3.bat IF ERRORLEVEL 1 goto bad3 echo nightlyBuild3.bat was successful! goto end :bad1 echo there was an error in nightlyBuild.bat! goto nightlyBuild2 :bad2 echo there was an error in nightlyBuild2.bat! goto nightlyBuild3 :bad3 echo there was an error in nightlyBuild3.bat! goto end :end echo end of batch Quote from: betty1 on October 08, 2007, 04:29:56 PM thanks for your speedy reply. Am I on the right track? Yes, you are! Well done! I think you missed a 1 here... Quote :bad1 also you don't need the lines in red (they are redundant) Quote call nightlyBuild1.bat thanks a looooooooooooooot for all your help. Since I want the main batch file continue call and run other batch files even if the nightlyBuild1 has not exited successfully. I thought IF nightlyBuild1 retuned an errorlevel of 0 then the nightlyBuild2.bat will be skipped, that’s why I added the redundant line in my script to call the label “:nightlyBuild2”. After I re-read your message again, I thought that I misunderstood the IF and errorlevel concepts. In fact, IF nightlyBuild1 retuned an errorlevel of 0 then the IF statement will return false, and then the program will go to the next line. Am I right? Thanks, Betty Quote from: betty1 on October 09, 2007, 09:45:45 AM In fact, IF nightlyBuild1 retuned an errorlevel of 0 then the IF statement will return false, and then the program will go to the next line. Am I right? Hi Betty Yes, you are absolutely correct. If the IF test returns a 0 value, no diversion of normal program flow will happen. For a mental exercise, you could try imagine what the code will look like if you tested for errorlevel 0 INSTEAD of 1. An unconnected note about ERRORLEVEL (since you sound nice!) Some programs are capable of returning multiple errorlevels. Since IF errorlevel N will return TRUE for any errorlevel equal to or greater than N, to get the right one, it is necessary to test in descending order. For example suppose you had a program that had 5 possible errorlevels LaunchSpaceship.exe IF errorlevel 5 goto alien-attack IF errorlevel 4 goto out-of-fuel IF errorlevel 3 goto pilot-is-drunk IF errorlevel 2 goto pilot-is-tired IF errorlevel 1 goto ships-cat-is-hungry echo SUCCESSFUL LAUNCH goto next :alien-attack (etc) :next Hello Contrex, Thank you very much for PROVIDING me this very interesting example. I feel I have learned a lot from you today and yesterday. So, I'm really grateful for that. Have a nice day, Betty |
|
| 8991. |
Solve : How to send an argument to a exe command in batch file.? |
|
Answer» Hi All,
I wrote before... (Did you read it?) Quote Could try |
|
| 8992. |
Solve : Invalid system disk? |
|
Answer» WINDOWS 95, Windows 98, and Windows ME users 1. Boot from a bootable floppy DISKETTE. 2. At the A:\> type fdisk 3. If you receive a message no FIXED disk present, read Hard Disk drive is bad or not connected properly. 4. If you are able to get into fdisk, choose option 4 to display the partition information. In the partition information, if the System is listed as FAT16 or FAT32 then continue to step 5. If you have a message indicating no partitions defined, no information is on your hard disk drive and you will need to create a new partition. See our fdisk page for additional information. 5. If you see FAT16 or FAT32 in fdisk press the ESC key until back at the A:\> 6. Once at the A:\> type, sys c: (only do this command if you are using the same operating system that this diskette was created on). 7. This should return a message 'System Transferred', if you receive bad command or file name and have verified you have typed the command properly, you will need to obtain a bootable diskette with the file sys.com on it. 8. If system was transferred successfully, reboot the computer and issue should be resolved. The Question are, where can i download that "sys.com" Sys.com should already be available on your dos bootable floppy. If you want to download Sys.com Google for 'download sys.com' and take your pick of which one you want.. And if you want to download a complete Dos BOOTDISK go here. Good lucktq Dusty, i just realize that when i use my boot disk.I'm posting this thread because it's keep saying "bad command" when i type the command sys c: but after i run the scandisk /all twice, and do that command goes through and the sys c: successful. Tq anywayTry sys C:\ ... |
|
| 8993. |
Solve : Running Batch script over a period of interval of time.? |
|
Answer» I am uploading data from text file to MySQL by using Bach file .I am using following command on command prompt |
|
| 8994. |
Solve : copy command? |
|
Answer» i had a little problem with the copy COMMAND. when i use: |
|
| 8995. |
Solve : right arrow symbol at end of text file?? |
|
Answer» I'm GETTING a RIGHT arrow symbol at the end of my text file. I have several text files that i'm merging together and then moving to another folder with a new name. Here's a sample of what I'm doing: |
|
| 8996. |
Solve : pass an instruction from a DOS command to a program ?? |
|
Answer» I don't think it's possible but I'll ask, just in case.
The above was found on this page:- http://www.vbforums.com/showthread.php?t=345259 It is in the VBForums section: VBForums > VBForums CodeBank > CodeBank - C++ Where there is a discussion about Quote Use API to programmatically click button of another app There is much more out there about this sort of thing. Google is your friend. Contrex, you're the man! I needed to be pointed to the right direction and you did just that. As I said, I just started learning about C++ classes. There's no way I could implement something like that right now. I'm working on a rather complex personal project and there's one essential bridging step which consists of the transfer of data between two different programs, the first being unable to export and the second unable to import. So far, the only way to do it was by using manually a small EXE utility. So either I can control it through my own code or I can write some code that does the same job. I also have restrictions about the C++ compiler I can use (g++, part of the gnu GCC). There is a windows.h header file in the GCC library in which I'll have to dig. Later. Thanks for shedding some light on my problem. Now I have a better understanding of it. And I know it's feasible. Quote Google is your friend. Yep, the Google button in my browser is starting to show WEARING marks... Thanks again, Contrex. I'll see you around, probably in the programming section. Have a nice day. |
|
| 8997. |
Solve : re-advertised need help Pllllleaaaaaasse? |
|
Answer» Hi i'm new to batch file scripting and was wondering if anyone could HELP me doesn't like the spacesIf the path is C:\Documents and Settings\user\file.txt, You have to put " on each end. "C:\Documents and Settings\user\file.txt" |
|
| 8998. |
Solve : position and size ?? |
|
Answer» Hello. I'm new to this forum and BATCH scripting. My question is in two parts. |
|
| 8999. |
Solve : Batch to list files modified today in text file.? |
|
Answer» Can anyone tell me what the batch file command(s) are to write a list of all "*.doc" modified today to a text file. Any help would be greatly appreciated.Is this your homework? ghostdog, he wrote he didn't want anyone to write him a batch file without trying it himself, so what do you do? Write him a vbs script!any problem with that? i did not write a batch for him, did i? you have already provided him guidance, so i guess he will try to do the batch himself. there are many ways to solve a problem, i am just showing him some other ways. Somebody may COME in and do a Perl script for him, who knows?... if he wants to stick with batch, that's entirely up to him. Quote Is there any situation in life that does not prompt you to churn out a vbs script and post it?1) when i am unhappy 2) when i am busy 3) when i don't feel like it. this is a public forum, what i post are valid suggestions/solutions that may/or may not solve the problem, as long as i don't violate posting rules (or be rude to people and get banned). You can't stop me from posting just because you feel you don't like it. Just like i can't stop you from asking people "is this homework" everytime someone does that, right?.Sorry, Ghostdog, for being testy with you. I had just got up! Actually that is a very interesting VBscript you contributed. Quote from: contrex on October 02, 2007, 02:00:27 AM Sorry, Ghostdog, for being testy with you. I had just got up! Actually that is a very interesting VBscript you contributed.hey..no problem the script follows the method you posted. I was able to write a batch file to do it, but I am always interested in learning new way to do things. Thanks to both of you for your help. I thought about trying vbscript but I would be totally lost on that, so maybe I will try it after I get my batch files working without needing daily input from me (which I am almost there thanks to contrex's help). Thanks again, Psycho DanI think you will be using delayed expansion inside the loop Contrex I am a newbie to this myself but I have noticed that you tend to have an "I really cant be arsed with helping but !! I will, under duress attitude" and then you can can be quite helpful are you manic depressive. Cos it really doesn't help when u dont know what your doing then some one makes you feel moronic for asking. So lighten up we aint all "au fait" with this and we dont want to be hand held just pointed in the right direction Quote from: w33man on October 05, 2007, 08:26:55 AM Contrex I am a newbie to this myself but I have noticed that you tend to have an "I really cant be arsed with helping but !! I will, under duress attitude" and then you can can be quite helpful are you manic depressive. w33man, thank you for your interest in my mental health. Comment how you like about the ACCURACY or otherwise of my answers. It's a free forum. Catch me out in an error - great. The truth is served. Answer a question better, more fully, more helpfully than me - fantastic! Way to GO! But - consider the ratio of 7:1882. That is how much weight I attach to your opinion about my attitude and personal style. Well, rather less actually. Sorry but there it is. (Paraphrase: go pound sand.) |
|
| 9000. |
Solve : Need to merge 2 text files? |
|
Answer» I have an existing batch process to which I need to add a routine which merges lines from 2 text files into a single file. I'm not looking to simply append one file to the other, but need to merge the files on a line-by-line basis. Otherwise, the vb script certainly accomplishes the task, but seems to require the use of a second file.which second file are you talking about?I've got a batch process (___.bat) which would then call the ___.vbs file, so the ___.vbs file is the second file. If possible, I'd prefer to have all of the code contained within the original ___.bat file.Quote from: ranman65 on October 05, 2007, 09:54:58 AM I've got a batch process (___.bat) which would then call the ___.vbs file, so the ___.vbs file is the second file.create the vb script dynamically in your batch file. hint: using echo with REDIRECTION > then call the script as normal using cscript. However, if that's not desired, pls wait for a pure batch solution.OK -- that works like a charm (using "^"s to set off the right parentheses and ampersands so they don't get misinterpretted when the batch job is processed)! Thanks, again! |
|