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.
| 6351. |
Solve : Concatenate Path (in quotes)and file name? |
|
Answer» Hi, It might be easier to use the old 8.3 notation: You can discover for yourself the correct name by running a directory list on the parent directory: dir /x C:\myStuffs OR Use your original method but APPEND the quotes on the program call: set SOL_PATH=C:\myStuffs\myproject\win\build devenv "%SOL_PATH%\a.sln" /build "Debug" 8-) Thanks... That was a nice solution indeed... I never thought in that direction... apending the quotes on the program call solves my problem... So simple... thanks again to sidewinder -manirup Quote You can discover for yourself the correct name by running a directory list on the parent directory:manirup, You will never have this problem when you work without quotes until you need them. I.e.: CODE: [Select]set SOL_PATH=C:\myStuffs\myproject\win\build PUSHD "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE" devenv "%SOL_PATH%\a.sln" /build "Debug" Hope this helps |
|
| 6352. |
Solve : Run Batch without command window popping up?? |
|
Answer» Hello all, |
|
| 6353. |
Solve : SET yourname?? |
|
Answer» Is there some way I could have a batch file echo "type your name" and then in another PART of the BATCHFILE it WOULD fill in thier name?: |
|
| 6354. |
Solve : Change BIOS Logo? |
|
Answer» Dear Members, Thanks for your replay, regading to motherboard model its "[highlight]PCPartner[/highlight]", can i change BIOS Logo I have never HEARD of a PCPartner motherboard. Try running Belarc Advisor (FREE at www.belarc.com) and find out the make and model of the motherboard.U can use this for only "AwardBIOS" (all required info is in...) but is not english http://www.free.of.pl/b/blackware/blc.exe or http://www.softpedia.com/get/Tweak/Video-Tweak/NVIDIA-BIOS-Editor.shtml |
|
| 6355. |
Solve : Access to HDD after booting from floppy?? |
|
Answer» I am trying to set up an OLD 486 Acer pc for some equally old DOS based games. I thought I had enough patience to wipe all the dust, and then this came out almost inmediately: Just after getting the A: prompt, my first impulse was to type C: and all I get is a "Invalid Drive Specification" message. Isn't it supposed that the BIOS should "build" the required paths so that the operating system has access to this drive? What MUST be there in the boot FLOPPY disk to make sure I will be ABLE to change the path to the hard drive after booting from floppy? |
|
| 6356. |
Solve : Question on IF command? |
|
Answer» can i have a IF statement follow with 2 process after the IF? EXAMPLE like can i have a IF statement follow with 2 process after the IF? example like you could actually test your commands out and verify for yourself... you can also use the & operator. eg if EXISTS & There are several ways you could have an IF statement follow multiple processes. Here are some examples: Code: [Select]if exist c:\test.txt rmdir c:\abc&xcopy c:\def c:\abc\ Code: [Select]if exist c:\test.txt ( rmdir c:\abc xcopy c:\def c:\abc\ ) Code: [Select]if exist c:\test.txt goto :Label1 rem more code here if necessary goto :EOF :Label1 rmdir c:\abc xcopy c:\def c:\abc\thanks all... |
|
| 6357. |
Solve : Installation of DOS 4? |
|
Answer» I am TRYING to install DOS 4 on one of my COMPUTERS so I can install Windows 3.0... |
|
| 6358. |
Solve : help with iplist batch file? |
|
Answer» I want a batch file that will make a list starting at 0.0.0.0 and ending at 255.255.255.255 but when one # hits 255 it needs to ADD 1 to the # on its left? this WOULD make a list of all posible ip address is this corect or would it leave some out?Quote this would make a list of all posible ip address is this corect or would it leave some out? A correctly written batch file would indeed cover all 4,294,967,296 of them. Code: [Select]@ECHO off set octet1=0 set octet2=0 set octet3=0 set octet4=0 :loop set /a octet4=%octet4%+1 if %octet4% GTR 255 ( set /a octet3=%octet3%+1 set octet4=0 ) if %octet3% GTR 255 ( set /a octet2=%octet2%+1 set octet3=0 ) if %octet2% GTR 255 ( set /a octet1=%octet1%+1 set octet2=0 ) echo %octet1%.%octet2%.%octet3%.%octet4% if %octet1%.%octet2%.%octet3%.%octet4%==255.255.255.255 goto :eof goto loop Why anybody would need such a thing is beyond me, but hey what do I know :-? Hey sidewinder, I've always wanted to know, what do "(" do in a batch file???that was like the solution i FOUND, i was just wondering if it would get all of them.Or SIMPLY: [edit]for /L %%a in (0,1,255) do ( for /L %%b in (0,1,255) do ( for /L %%c in (0,1,255) do ( for /L %%d in (0,1,255) do ( echo.%%a.%%b.%%c.%%d ))))[/edit] dakota, If you plan to ping all IP addresses and let's say a single ping takes 1 second and you start your batch script today ([timestamp=1155103143]) then the script will finish on 9/15/2142 which is a Saturday HAHAHAHAHAHAHAHAHAH Yes, I think he is/was planning to ping them!! |
|
| 6359. |
Solve : workgroup ?? |
|
Answer» what command can i find out my workgroup ?This MAY WORK on a workgroup network: |
|
| 6360. |
Solve : # of dir's? |
|
Answer» I want to get the NUMBER of dirs in the current directory that I am in but here is my PROBLEM somtimes there will be a . and a .. in the numbers of dirs so i want to know the number of dirs not counting the . or the .. if they are there. Think you any help is appreciated |
|
| 6361. |
Solve : MS Dos Small Program Help? |
|
Answer» Hi i'm CONSTRUCTING a program that deletes MP3's, WAV's etc from a particular drive. thanks, so will this replace or just add to the file for successive file types if repeated? using >> will append your results to the output file.for /R z:\ %%a in (*.MP3 *.WMA *.WAV *.EXE *.WMV *.CDA ) do ( del /f %%a ) does all filetypes in one loop recursive. (The if statement doesn`t work on my NT4 machine in a for loop. Seems that I have to call a procedure)that program just deleted everything of my hardrive Richwow...always do a test first before using del /fQuote that program just deleted everything of my hardrive Strange. I did a test (with echo); it echoed only the SAID filetypes. uliQuote Quotethat program just deleted everything of my hardrive probably substitued the "z:\" for "c:\" |
|
| 6362. |
Solve : "(" in a batch file!? |
|
Answer» What do brackets do in a batch file??Have you lost your Google finger :-? |
|
| 6363. |
Solve : Verfiy DOS Copy? |
|
Answer» Is there a way to verify a file that was COPIED USING the COPY command |
|
| 6364. |
Solve : Find string? |
|
Answer» I figured away around another ISSUE, and this should be simplier. |
|
| 6365. |
Solve : How to force a particular dateFormat for batch.? |
|
Answer» Hi there: |
|
| 6366. |
Solve : Label Issue? |
|
Answer» I FINALLY got my batch file to WORK on my pc at home, brought it to work and I ran into a slight issue. |
|
| 6367. |
Solve : catching control characters? |
|
Answer» HI 1. I need to do telnet in a batch file just for validation and invoke some 'X' application 1) when you say invoke 'X' application, is 'X' at remote or local? 2) how restricted are you? you can't run WSH/CSRIPT (vbscript) even? 3) u can try setting your batch to telnet to server using automatic login (-a) or (-l) eg telnet -a host , or telnet -l username host If all else fails, you can try ftp login using the -s option , if the user has supplied the correct credential and password, he can continue. Thanks ghost I can use wsh/cscript. Could U provide me a working example. Inside the script, I just telnet to a Unix server and EXIT from the telnet session and invoke some 'X' application which is a local one NOT a remote one. The reason for telnetting is just to validate the Unix login. If his password expires, it will force and he can change the password at regular intervals. ThankX again for ur prompt response.don't know whether it works. you can try it out http://sourceforge.net/projects/telscript/ |
|
| 6368. |
Solve : suppressing password in telnet batch file? |
|
Answer» Hi |
|
| 6369. |
Solve : Having Problem FDISK with newly built system? |
|
Answer» I have rebuilt a system but I have 2 problems. I'm sure one is easy to fix but the other I am totally confused. First I have a DIFFERENT hard drive in there now and I tried to format using the software from the manufacturer but it wont boot from the CDROM so I decided to go into the BIOS and change the sequence so it will boot from the CD.....BUT..... here's my second issue....when I get to the BIOS, the main PAGE for the motherboard comes up with no problem until I decide to hit enter or something then it askes for a user password. I have no idea! I checked and its a 3rd party password so I cant override it and I cant contact anyone because I DONT know built this system originally. Can anyone tell me how to bypass the password, (I can do sequence in DOS) and last how do i change the drive VALUE again in DOS? so that I can run fdisk... Thanks :-/Sounds like you have a BIOS password set. You can probably clear the BIOS password by changing a jumper position, or by removing the computer battery for a minute or so.If I remove the battery, dont I have to reset the CMOS or realtime clock? I dont know how to do that yet. It will revert to defaults, which you can then change. The clock is easily set in the BIOS. You may have to leave the battery out for 10 minutes or so. |
|
| 6370. |
Solve : Compare file date-stamps in a batch file? |
|
Answer» I have an Excel application with which the user runs a batch file that copies a template from a server to their local drive and then opens the file. I would LIKE to add funtionality that would CHECK the file on the server vs. local disk and if there was no change I would skip the copy function. |
|
| 6371. |
Solve : what is a dos? |
|
Answer» plz GIVE me answer |
|
| 6372. |
Solve : Start up computer error?? |
|
Answer» I've got an older laptop and when I start the up and log into windows 98, I get MS-Dos error that comes up and it READS: Microsoft Cabinet extraction tool - version (16) 1.00.603.0 |
|
| 6373. |
Solve : pausing output? |
|
Answer» This is a *very* simple question from SOMEONE who hasn't used MSDOS for 10 YEARS and THROWN all the BOOKS away! |
|
| 6374. |
Solve : WIN XP Recycle? |
|
Answer» hi, |
|
| 6375. |
Solve : NEED TO KHOW N/W CONNECTIVITY? |
|
Answer» HI all (NEED SCRIPT) I am using Windows xp OS and need help on a two simple issues. I'll really appreciate if you can help me. Issue 1. I want to ping an IP address continuosly and log the ping results as text file. If it is possible, I want to execute both commands(ping and log) in the same line. What would be the correct command syntax? (I MEAN I need to execute both ping and log with one "ENTER") PS: I have to see the ping REPLY packets on the screen while it is being logged at the same time. Issue 2. I need to ping 20 IP addresses on 20 command line windows at the same time, log the ping results as well. In other words I need to do Issue one on 20 windows and 20 IP addresses. Could you help me how to create a script about do Issue 2 with one command? command line window 1: pings and logs 172.17.48.2, command line window 2: pings and logs 172.17.49.2, ... ... command line window 10: pings and logs 172.17.48.66 Thank in advance for helping SmileyNot sure I understand all this. Are you using one logfile for all the pings? You want to have 20 separate windows open all running a ping? You can run one ping and log the results with redirection: ping -n 1 127.0.0.1 >> log.txt By preceding the ping with a start command, you trigger off many pings all running in separate windows. Problem: Text files cannot be shared by multiple processes; Once one process opens the log file, all others will be locked out and the each ping will fail. Perhaps if you could tell us what you're trying to accomplish, we could find another approach. If you want output both on the console and logged to a file, you may need to use one of the Windows scripting languages. 8-)Whats a ping?? For issue 1, I don't know of a way to log to file AND screen without an external utility. You can get the TEE.EXE command from http://unxutils.sourceforge.net/ and then you could use something like: Code: [Select]ping -t 127.0.0.1 |tee ping.log For issue 2, you could replace the real IP address in the parenthesis and do something like this in a batch file: Code: [Select]@echo off for %%a in (172.17.48.2 172.17.49.2 172.17.48.3 172.17.48.4 172.17.48.5) do ( echo ping %%a ^> Ping%%a.log >%%a.bat echo del %%0 2^> NUL ^&exit>>%%a.bat start %%a.bat ) If all the IP addresses are in a row (or some pattern) you could change your for loop to automate the generation of the numbers. |
|
| 6376. |
Solve : get into the regitery from ms-dos? |
|
Answer» how do i get into the registery from ms-dos? hmmm.. [highlight]don't know what you meant in your previous post[/highlight].. but you can access the registry through the command line using the reg tool.. just type in reg /? for the options.. and uhm.. i think this is only available in XP.. and 2k? not sure.. He meant there is no DOS involved. Win2000 and XP have command prompt which is NOT DOS.i need to get into the regedit and delete a file from MS-DOS, im not able to go into it from the other place... EDIT : its via windows XP Start/Programs/Accessories/Command Prompt? Could it be that easy?ehrm, yes, then u open your cmd but i need to get into regedit from there REGEDIT is a Windows program and will run in Windows whether you launch it from the Run box or the command prompt. REG runs as console program (no Windows) and uses run-time parameters (user supplied) in batch mode. Usually used in batch files. Scripts use ANOTHER METHOD to access the registry. Quote i need to get into the regedit and delete a file from MS-DOS, im not able to go into it from the other place...Please explain this more. 8-) I googled a little bit and found a tool called "Erunt". It can SAVE all registry hives from Windows (NT/W2k/XP) and also play it back from M$-Dos. That might be a possible solution. Not elegant to write the complete registry but... I didn't check it myself. hope it helps uli |
|
| 6377. |
Solve : TREE Command? |
|
Answer» What I want to do is use the tree COMMAND in MS-DOS to make a txt or whatever file with the results of the tree command. I mean I want to make a file that contains the directories' and files' names in a specified directory/drive. If there is ANOTHER command other than TREE, I am open to suggestions....something else : I would like to make a txt file with the tasks/apps/services/processes that are being ran at a CERTAIN moment by XP....but make it with MS-DOS .... nobody COULD TELL me how to do that... http://www.stefysoft.comQuote What I want to do is use the tree command in MS-DOS to make a txt or whatever file with the results of the tree command. I mean I want to make a file that contains the directories' and files' names in a specified directory/drive. If there is another command other than TREE, I am open to suggestions....something else : I would like to make a txt file with the tasks/apps/services/processes that are being ran at a certain moment by XP....but make it with MS-DOS .... nobody could tell me how to do that... http://www.stefysoft.com tree graphically displays your folders, is that what you want. ? you can use dir /S . Check out the dir command help . dir /? for listing out tasks/process, can try tasklist. Type tasklist /? and see what it offers you. to "make a txt file", just do an output redirection , eg tasklist >> output.txtI've found what I wanted ghostdog74 ...thanks... |
|
| 6378. |
Solve : Dos Boot disk? |
|
Answer» Hi all, |
|
| 6379. |
Solve : launching new excel? |
|
Answer» hi guys, sorry if i make something wrong. this is my first time here. hi guys, sorry if i make something wrong. this is my first time here. this is the way i solved the problem. as i read in the xls help. excel opens a new blank workbook from c:\PROGRAM fils\microsoft\....\xlstart directory. my batch file was in the same directory. So, i put the batch file in the previous directory (excel). and MAGIC....... thx, to all of u . max. |
|
| 6380. |
Solve : cant start dos? |
|
Answer» Hi new here and I have a quick question. I am trying to open one of my programs and every TIME I do I get a message that states..... It Means Microsoft put a little line of code in to one of the Files in Service Pack 2 that says You cant use dos stuff any more NA NA NA Yeah just tried that what a joke, cant figure it out for the life of me. now I know why I hate these frickin boxes of junk so much. All I want to do is click the program and have it open with out having to jump thru hoops. HOW HARD IS THAT? DAM COMPUTERS We used to have a FAQ on this problem but it seems it has gone missing. Autoexec.nt Good luck. 8-)It has been bumped down by less important, though newer stuff. Anyway the above info will get you there. I tried what it and you said. I clicked start, run = cmd box pops up cmd is not a valid win32 app? now what?If there is an error with CMD then you can't run CMD to fix the problem If the issue continues to occur, copy the Autoexec.nt and Config.nt files from the Repair folder in Windows to the System folder. To do so, follow these steps: 1. Click Start, click Run, type c:\windows\repair, and then click OK. 2. Right-click autoexec.nt, and then click Copy. 3. Click Start, click Run, type c:\windows\system32, and then click OK. 4. Right-click ANYWHERE in that folder, and then click Paste. 5. Right-click the Autoexect.nt file that you just copied, and then click Properties. 6. Click to SELECT Read-Only, and then click OK. 7. Repeat steps 1 through 6 to copy the Config.nt file. Kudos to Microsoft. 8-) |
|
| 6381. |
Solve : multipule lines as a var? |
|
Answer» i could have it go only to a file and have my batch file use that file and then out put to a new file and delete the temp file with the file list in it.any help because when i have it go out to a file it goes out as only the first line.Post your code so we can help you troubleshoot the problem.@echo off OMG are you serus it is that easy i could never figer out what the - was for (prefix meaning not???) <--still dont get what that means but think you.i suppose you are taking about dir /a-d ? check out dir /? .. it explains... Code: [Select] /A Displays files with specified attributes. attributes D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not "-" meaning not... so /a-d means display files, not directories...think you so much i have been working on this 4ever i cant beleav that all i needed was a simple - lol ok think you very very much. |
|
| 6382. |
Solve : Simple Copy Access Database Batch File? |
|
Answer» Hi, |
|
| 6383. |
Solve : A randomizer??? |
|
Answer» Is it possible to make a batch file that gives you random answers? Like if you wanted to choose your lottery #'s or something you could put in all the possible #'s and it gives you a random ONE every time? Thanks, it worked!I was just thinking; is there maybe a way to have a group of variables? Then you could make show a random variable from that group? Or is there another way?Yes, you can do this with months or anything else by setting up an array. Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=3*%num%-3 call set mon=%%array:~%disp%,3%% echo %mon% goto loop This EXAMPLE has no exit; use CTL-C. Quote Or is there another way?Yes, learn Windows scripting...always use the right tools for the job. Batch is a command language not a programming language. 8-)Everytime I click on it, it says april! And I deleted the "goto loop" and changed it to pause!There are two goto loop statements. In any CASE, the example works as advertised. You break it, you buy it. Quote Is it possible to make a batch file that gives you random answers? Like if you wanted to choose your lottery #'s or something you could put in all the possible #'s and it gives you a random one every time? In Python, Code: [Select]>>> import random >>> random.randrange(1,100) #assume lottery NUMS range from 1,100 50 In Perl Code: [Select]print int(rand(100)); In windows scripting, an eg here http://www.microsoft.com/technet/scriptcenter/resources/qanda/may05/hey0518.mspx In batch, yes, you can do that in batch too, if you are bored. This is what I changed it too: Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=3*%num%-3 call set mon=%%array:~%disp%,[highlight]3[/highlight]%% echo %mon% pause cls goto loopCan I change the highlighted # to make the words longer??? And if it's not too confusing, could yoyu maybe explain how it werks??If you change the length of the occurances in the array you'd have to make changes in two of the statements (see below). Use either trailing spaces or leading zeroes for padding if necessary. The example was SETUP with equal length occurances. For unequal length occurances you'd have to take a different approach and use a delimiter between each member of the array. If you change the number of members in the array, you would need to change the divisor for the num calculation. Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=[highlight]3[/highlight]*%num%-[highlight]3[/highlight] call set mon=%%array:~%disp%,[highlight]3[/highlight]%% echo %mon% pause cls goto loop How does it work? I could never do justice to the simple eloquence of this batch code. Turn echo on in the file. Watch and learn. A Windows script would be a better choice, but to each his own. 8-)I still don't quite get what #'s to change to change the random word! Like what would be changed if this digit was changed??: Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=[highlight]3[/highlight]*%num%-3 call set mon=%%array:~%disp%,3%% echo %mon% pause cls goto loopAnd what would be different if this digit was changed?: Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=3*%num%-[highlight]3[/highlight] call set mon=%%array:~%disp%,3%% echo %mon% pause cls goto loopThis one?: Code: [Select]@echo off set array=JanFebMarAprMayJunJulAugSepOctNovDec :loop set /a num=%random%/2730 if %num%==0 goto loop call set /a disp=3*%num%-3 call set mon=%%array:~%disp%,[highlight]3[/highlight]%% echo %mon% pause cls goto loopQuote Like what would be changed if this digit was changed??: The best answer would be for you to turn echo on, change each number and see what happens. Also check out the documentation for the SET statement which explains how to extract a substring from a string. Hint: the SET statement uses offset and length Good luck. 8-) I've noticed many of your posts concerning "DOS". Perhaps a trip to the library for a good reference would be helpful. Online, Allenware can be useful. Yes, i know it's not DOS!! it's command prompt! Thanks for all your help by the way! |
|
| 6384. |
Solve : access files 2 level up and 2 level down? |
|
Answer» Hi, |
|
| 6385. |
Solve : CMD enabling? |
|
Answer» Hi there, |
|
| 6386. |
Solve : Backup Folders!? |
|
Answer» How can you make a batch file that makes backups of a certian folder EVERY hour or two? And then, if possible, delete all those folders at the end of the day? I know how to make a backup!! I just need to know how to start it at a certian time!!Never mind I just realized I can use task SCHEDULER!!Quote I know how to make a backup!! I just need to know how to start it at a certian time!! That was a google link to 7,920,000 hits on how to do what you asked. Did you look? Was that not enough? The first few ones were very clear, but it did require you reading them. |
|
| 6387. |
Solve : Dos-based computer problem? |
|
Answer» Hi, I have a dos based computer (Vectra by hewlett packard). For some reason, my computer started to print out BLANK pages and appeared to crash. When I turned it back on, the computer remains on the black screen, and I am unable to input commands. Any Ideas on what the problem is?What version of DOS? YOu need to be very specific about what happened prior to this and the exact issue. Were you printing something and a blank PAGE came out, or for no apparent reason your printer INITIALIZED and started SPITTING out paper, or what? |
|
| 6388. |
Solve : statement? |
|
Answer» I'm for some UNKNOWN reason in a particularly foul MOOD this afternoon and i can't figure out why... |
|
| 6389. |
Solve : Copy folder to another computer? |
|
Answer» Hallo, |
|
| 6390. |
Solve : Need help creating BATCH file... Can you help?? |
|
Answer» :-? :-? :-? |
|
| 6391. |
Solve : Batch File to Copy a File at Fixed Schedule? |
|
Answer» I want to copy a file called D:\EMPMST1.DBF to C:\COPYBAT every night at 2355 hrs. |
|
| 6392. |
Solve : Increasing dos display? |
|
Answer» Hey hows things, |
|
| 6393. |
Solve : Merging 2 files,seperated by space not by new line? |
|
Answer» Hi, |
|
| 6394. |
Solve : Vista? |
|
Answer» Has anyone tried the Beta of WinVista? If so, I have a question that has been burning through my head: Does the OS have a command prompt that still accepts the same DOS commands as WinXP and SIMILAR OS's?Idk i have hade the beta even before it whent to public beta but i never put it on my pc but i know some people that are running it now and i will ask them. Yes, same command shell and same commands as Windows XP.Really? Then what's this MONAD I'm hearing about?MONAD is new shell by MS that is supposed to be very powerful. I downloaded a beta of MONAD a few months ago, but it was VERY different from CMD.EXE, so quickly went BACK to CMD.EXE until I have time to re-visit the new shell (which I haven't yet). I think you can download it, but I didn't notice it at all in Vista. It MAY be an option for Vista, but I know that when you click on the "Command Prompt" icon, you get the good old CMD.EXE with the same syntax and commands as XP.Here is INFO on MONAD and the page also contains a download link if you want to give it a try: It may be an option for Vista, but I know that when you click on the "Command Prompt" icon, you get the good old CMD.EXE with the same syntax and commands as XP. What a relief. I have MONAD and I'm not thrilled with it; it has a few new commands, but I noticed that COPY CON is unavailable. Not a good start, since I despise EDLIN. But that's just me. |
|
| 6395. |
Solve : two MS-DOS 6.2 questions? |
|
Answer» Allright, I know it can be done, with I *think* one command, but I can't seem to find it anywhere. I need to beable to be in root, and do a search for one word and have it look in all files and directories for that word. and no the command I'm thinking of isn't find. |
|
| 6396. |
Solve : After rebooting PC .bat not work? |
|
Answer» Hello agian, |
|
| 6397. |
Solve : How do you pass value from output to input and verify? |
|
Answer» Could SOMEONE assist me in figuring out how to grab the DAYS value from the systeminfo command, so that it could be tested to be less than 15. And if greater than 15 execute a shutdown -r to reboot the computers/servers??? Contrex's code looks good, except I think there might be problems using quotes in the GTR comparison. I got in the habit of using quotes for IF comparisons, I don't seem to have encountered any problems so far. What sort do you envisage? (Always glad to pick up tips). Do you mean because the data is numerical? I tried that code with dummy data from 1 to 999 and they all worked fine. Contrex: I might be wrong, and I can't remember for sure. But I think it was something like using quotes (or anything non-numeric) in a numeric comparison (GTR, GEQ, etc.) changes the comparison to text / alphabetical comparison instead of a numeric comparison. If that was the case then 10 < 2 because 1 < 2. Does that make sense? Let me know if I didn't explain it well, but basically I think it is an ASCII vs numeric comparison issue.Quote from: DaveLembke on May 25, 2007, 10:41:53 AM ....there was no option for bi-weekly which is what I need. I thought there is? you choose weekly task, then on the next screen, there's option for you to specify how many weeks and which day. but correct me if i am wrong though.. Quote from: GuruGary on May 25, 2007, 03:26:20 PM Also, you CAN add a reboot (SHUTDOWN.EXE) to your scheduled tasks. Choose "Weekly", then it will give you an option to run every X weeks, and you can choose 2 weeks. Or you can choose "Daily" and choose every 15 days.Quote from: GuruGary on May 25, 2007, 07:30:33 PM I think it is an ASCII vs numeric comparison issue. Code: [Select]c:\>set num1=10 c:\>set num2=2 c:\>if %num1% GTR %num2% echo %num1% is greater than %num2% 10 is greater than 2 c:\>if "%num1%" GTR "%num2%" echo %num1% is greater than %num2% c:\> Exactly right. Thanks for the hint. Streamlined version, no temp file, no labels, shutdown in 10 seconds, force running apps to close without warning. You may want to modify shutdown behaviour, add more lines, etc, this is just an example Code: [Select]set maxupdays=14 for /f "tokens=2,3,4* delims= " %%a in ('systeminfo ^| @find "Up Time"') do set updays=%%c if %updays% GTR %maxupdays% ( shutdown -r -t 10 -f -c "Scheduled restart in 10 seconds" ) Many Thanks Contrex!!! This works well. I also edited my shutdown to be more specific like you suggested, just in case something wants to STAY open hanging the reboot. Dave |
|
| 6398. |
Solve : kernel help? |
|
Answer» hey everyone i am having PROBLEM with my pc (WIN98 SE), when it boots it say kernel error reinstall window. i went in dos and i renamedd the kernel32.dll 2 kernel32.ch . but i need 2 extract the kerenel32.dll from he win98 cd. i dont have any cd 4 the computer ,is there any WEBSITE where i can get them, or is there any oher way 2 fix it.What about reinstalling Windows as suggested? Is that apossibility? You MAY have multiple other problems as well. What preceeded this?Re-installing is probably the best SOLUTION, but I don't KNOW of a way to legally get a CD other than buying one. |
|
| 6399. |
Solve : IF statement with variable? |
|
Answer» Hello, I am pretty sure that my problem is with the IF statements, but I am not sure what I am doing wrong. Thank you in advance for reading through this and I look forward to any guidance anyone can offer. Your problem is, that code is not batch language. It is some other language maybe not yet invented. There are 2 problems. The IFs and the labels. (1) IF statements in batch are usually like this on one line. You don't have "END". IF %ip% GTR 200 goto group1 IF %ip% GTR 190 goto group2 (2) You got the labels back-to-front. The colon goes BEFORE the label name :group1 .....do stuff.... EXIT :group2 .....do stuff.... EXIT It is not compulsory to put *anything* in a batch file in capital letters. If you want a multiline if, use braces (parentheses) like this if %ip% gtr 200 ( echo it was more than 200 echo another line goto group1 ) :group1 Or use & like this if %ip% gtr 200 echo more than 200 & echo some more text & goto group1 |
|
| 6400. |
Solve : path question??? |
|
Answer» my bro share out a movies name spiderman and i know that he put it in the f:\movies that he share out Just a quick question before you go, have you set up a shared connection? If you haven't, that's probably the problem (I tried this with my brother, and because we don't have a shared connection, it showed the message also). well we did have a share conection if not i wont be able to go into his pc searching for movies after my 1 hour hard work i finally made it i share it with you for LAN start \\urfrenorbrotherip\thefoldernametheyshareout for example start \\192.xx.xx.xx\spiderman\spiderman.avi |
|