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.
| 8151. |
Solve : looking for some 3rd Party MS-DOS encryption apps..??? |
|
Answer» anyone know of any 3rd party encryption apps that WORK LIKE cipher.exe does through cmd to encrypt ENTIRE folder contents but with DIFFERENT encryption types though...??TRY Here... |
|
| 8152. |
Solve : Backup Batch File? |
|
Answer» I am new to making batch files. What I want to do is make a backup batch file. |
|
| 8153. |
Solve : Need help with copy? |
|
Answer» Greetings all. This is my first post here. I was unable to find an ANSWER in previous posts. I basically do not know anything about DOS, but I have managed, by extensive trial and error, to create a batch file, Install.bat, to copy an Access database from a share drive to my local desktop as follows: |
|
| 8154. |
Solve : How to run more RELATED commands with the same variable read from a text file?? |
|
Answer» Hello! "tokens=* delims==" As far as I can see, "tokens=*" means "no token separators", ie parse the whole line, If the last character in the tokens= string is an asterisk, then an additional variable is allocated and receives the remaining text on the line after the last token parsed. (IE if the asterisk is the first and last character then there is no last token, and the whole text of the line is passed to the first variable) ... and "delims==" is equivalent to "delims=", ie "token delimiters are the start and end of the line", so this options block: "tokens=* delims==" is a kind of dummy placeholder meaning "process the whole line and don't split it". examples... Quote @echo off output... Quote data set="eggs bacon tomatoes" Quote Can you recommend me a good book or maybe a website where I can learn more about this stuff in this dept? You could type "FOR loop tutorial" into Google. This one is pretty good. http://www.student.oulu.fi/~vtatila/batch_tutorial.html#forContrex, Last night I noticed, that the "new reply notification" messages from this website were caught by my spam filter, that's why I didn't notice your reply until now. Thanks a lot for explaining to me basically the difference between the terms "tokens" and "delims" and how can you use any of them for indicating "take the whole line in a text file". Also, thanks for the link to Veli-Pekka's tutorial page on using "For", it is a GREAT page for learning DOS scripting! Geza |
|
| 8155. |
Solve : How to Write a Batch file that Closes an Application or File? |
|
Answer» Hello all, |
|
| 8156. |
Solve : Pinging ?? |
|
Answer» is it possible PING an specific ip and if the ip gives answer then RUN a specific command something ...and if the ip gives answer Ping ALWAYS gives a response so try and be more specific next time. It would also help us if you mentioned your OS. Code: [Select]@echo off ping -N 1 192.162.1.52 | find /i "reply from" > nul if not errorlevel 1 echo it works Good luck. 8-) |
|
| 8157. |
Solve : How to make a batch file wait?? |
|
Answer» Hi ! |
|
| 8158. |
Solve : How to escape | < > in a batch file.? |
|
Answer» Hey, I was just wondering how, when entering a value into a batch file you can automatically 'escape' out the characters that usually make the program close. "| < >". @echo off If the input was "|", how would I make it so "|" and only "|" is outputted to the file. No quotation marks either, I think they work?Escape the variable as if it were the character it would expand to. Quote
Quote
Yea, I probably didn't phrase the question properly. What if the variable included "< > |" anywhere inside it, eg "dksk>>|", for example. How would you enable that to be used by an if, echo or other command, without causing an error and EXITING?Quite honestly, DeltaSlaya, this is where I say to myself, "here be the limitations of command LINE" and DIG out QBasic. Life is too short. Ok, so it's just not possible? I thought that ":str1=str2" could work, I'm guessing it can't, and I haven't got it to work with it either.You did know you can make a batch file create and execute a Qbasic program? echo FOR J=1 TO 10 > dome.bas echo PRINT J >> dome.bas echo NEXT J >> dome.bas qbasic /run dome.bas Thus you could for example get a string input and get it into a file by passing the string to a QBasic program to do the file creation and writing. You'd have to be sure QB was present on the system, which up to Win ME, you were. @OP, if QBasic is not present on the system (which newer windows OS doesn't come with it), then the next best thing after DOS is vbscript (considering native requirement). Quote from: ghostdog74 on AUGUST 07, 2007, 05:51:48 AM @OP, Now, how did I know you were going to write that? Next best? Vbscript is way better than QBasic. |
|
| 8159. |
Solve : save ping results? |
|
Answer» Hello all, I am looking for a way to SAVE the machines names that actually reply BACK on my PING command BAT file that I run. |
|
| 8160. |
Solve : MSDOS is all thats left please help? |
|
Answer» The hard drive has it's own ribbon. The hard drive has it's own ribbon. no, im a little confused by this as the cdrom is at the top, and the hard drive is not within reach of the plug to connect them together. but i will try this i have nothing to loose. thanksQuote The hard drive has it's own ribbon. THIS WORKED!!!! i couldnt plug the hard drive and cdrom together but i did unplug the bottom adapti drive and booted up with the cdrom showing as R:..... i am so happy thank you dusty, and willy and everyone who helped... you are gonna be mad at me, but now i cant find my install cd Well done Geogia - success at last. We don't get mad we just get even. Very good to HEAR of a satisfactory outcome. Good luck i am so happy... unfortunately the ME operating system i had is an upgrade, so therefore i cannot upgrade without putting 98 in first... so i DONT at this point have an operating system to install.. (it was in the old cdrom i had to take apart to get it out ....anyway, all that came with the computor originally is the factory restore disk which doesnt work... so i still dont have an operating system, but at least i know now i can load one in... you are so great... thank you thank you thank you. do you know where i can download and burn one? if i am the orginal owner is there somewhere where i would have access to this again many thanks and good wishes to everyone who helped.. especially willy thanks for the patienceYou cannot legally download a Microsoft operating system. If all you have is a ME upgrade, you will need an older qualifying product. You don't have to install the older one first, just have the CD available when installing. So you are back where you started from. You need to install Windows.Im way ahead of where i started from, now i have a cdrom drive which i didnt before this all started.. i made the mistake of uninstalling the operating system with a disabled cdrom. i assumed the new one would work... it seems the adapti burner or second cd is bad, which i can live without so its all good. dont want to do anything illegal, wasnt looking to, i just wondered if i could get it somewhere using my serial numbers and product key or SOMETHING. the computor did not come with operating system cd's just a RECOVERY cd which i have but it doesnt work. a friend let me borrow a geniune windows ME cd, but it appears to be an upgrade which needs 98 installed first.... or a valid product key for 98 im not sure how that works.. in any event i feel im way ahead of where i was. i was ready to throw the tower in the trash.Quote
Now the question is: Where are some places to get a good deal on a legitimate Windows install disk. We're talking about versions prior to WindowsXP. The first thing that pops to mind is eBay. But that takes some patience, and willingness to measure and accept risk. That's up to you. If you feel you need some advice on places to look, you might want to start another thread as that is quite a bit different topic and will get the proper attention that way. You might want to ask what to expect to pay too. |
|
| 8161. |
Solve : HOW TO SEND MESSAGE (PING) IN LAN USING DOS? |
|
Answer» PLEASE give syntax to send a message for one COMPUTER to another computer in a local area network using DOS.Are you talking about real DOS or the cmd in 2000/XP?The last person to post here that actually had DOS was February of last year...Yeah okay, point taken PATIO. But another QUESTION then... Your subject says ping but it sounds like you want to send a message? If you want to ping a computer the syntax is ping and the computer name or IP. I'm a bit unsure about posting out the syntax for sending messages since I know some people will use these to annoy others. Fortunately the message sending ability has been disabled in XP service pack 2. But I'll wait with the command for sending msgs till the OP has GIVEN a reasonable explanation for wanting this. |
|
| 8162. |
Solve : recovery of my ecer commputer? |
|
Answer» put in my recovery disk for my acer aspire t100 COMPUTER says cannot RUN on windows nt PLEASE boot your system into dos then run gdisk. tried booting all orders didnt work :( tried GOING to run cmd run gdisk not recognized internal or external command need help thank youHave you tried booting the computer with the CD in the drive?thanks for your reply gx1 man tried rebooty with disk in cd drive , didnt work i think i need the right command in dos, recovery cd says in dos type in command rdisk so i go to run cmd which i think im in dos? then type in rdisk says rdisk is not a recognized internal or external command operable program are batched file dont understand why acel would give you a recovery cd disk that wont work in its preloaded windowsYour next STOP would be to contact Acer. |
|
| 8163. |
Solve : Changing to the next device in the boot sequence via DOS? |
|
Answer» Once booted into DOS from a USB Flash disk, is it possible to exit DOS and have the loader switch control to the NEXT device in the boot sequence (from USB to CD-ROM or Hard disk)? Thanks.No. |
|
| 8164. |
Solve : Make a .txt file form .bat? |
|
Answer» Hey everyone, i need help with something. |
|
| 8165. |
Solve : How to Check if a Certain Process is already Running..??? |
|
Answer» is there any code to check if a process is already running from a certain location..?? |
|
| 8166. |
Solve : Multi-Line file to Variable ...? |
|
Answer» Hello all, |
|
| 8167. |
Solve : read and write batch file include log file? |
|
Answer» is that posible to have a BATCH file that read and WRITE a storage device(hdd or Compact flash) in looping and generate a log file? |
|
| 8168. |
Solve : Windows is very stubborn? |
|
Answer» I need help with windows xp dos. I used a floppy to boot to dos and recieve a a prompt how do i CHANE this to get to the c prompt? I'm tring to remove windows xp and install windows 98 instead. There is no other op sys on the hd and i can't boot from install disk for 98Hi Mike - Welcome to the CH forums. You cannot use a Dos bootdisk to delete Win.XP if your hdd is formatted NTFS, Dos will simply not recognize NTFS. You can use the Delpart utility from here to delete the NTFS PARTITIONS or you could use your XP cd to delete partitions and reformat Fat32 in preparation for INSTALLING Win.98 Good luck |
|
| 8169. |
Solve : Need Help in combining two Excell files? |
|
Answer» Hello All, |
|
| 8170. |
Solve : START %~d0\ IF THIS FILE IS BEING RAN FROM THE ROOT OF ANY DRIVE? |
|
Answer» START %~d0\ IF THIS FILE IS BEING RAN FROM THE ROOT OF ANY DRIVE @echo off Probably a better way...Quote Probably a better way... Probably... code saved as F:\fpath.cmd: Quote
Quote
Quote from: contrex on August 07, 2007, 02:10:27 PM QuoteProbably a better way... How did my code do: " "fpath"=="F:\fpath.cmd" " Quote from: DeltaSlaya on August 07, 2007, 02:17:13 PM How did my code do: " "fpath"=="F:\fpath.cmd" " Like this... Variable modifiers (V=variable) Edited from FOR /? %~fV - expands %V to a FULLY qualified path name %~dV - expands %V to a drive letter only (and colon) EG D: %~pV - expands %V to a path only %~nV - expands %V to a file name only %~xV - expands %V to a file extension only %~sV - expanded path contains short names only %~aV - expands %V to file attributes of file %~tV - expands %V to date/time of file %~zV - expands %V to size of file modifiers can be combined to get compound results: %~dpV - expands %V to a drive letter and path only %~nxV - expands %V to a file name and extension only %~fsV - expands %V to a full path name with short names only Your code: if "%~0"=="%~d0\%~nx0" (goto yes) else goto no ^ ^ ^ | | | filename drive filename and extension | | | fpath F: \ fpath.cmd How come when I run the code: Quote if "%~0"=="%~d0\%~nx0" (goto yes) else goto no From the C:\ directory the output is: Quote C:\>if "C:\Test.bat" == "C:\Test.bat" (goto yes ) else goto no how odd. Will investigate. Whether I call it fpath.cmd or test.bat It works the same. My OS is XP Professional SP2, is yours different? I am running under cmd.exe Quote
This is what it does under XP command.com Quote
I know why, %~0 just shows how the batch file was initially started. If you open it in explorer it gives the file path, if you open it in a prompt it gives the line that started it.So the batch file would have to be written so it works regardless of how it was started. Well mine doesn't work if it is started from the command prompt by just its name, ie. fpath. Because then %~0 would expand to fpath. I suppose in a way it's like %cmdcmdline%, the line that initiated command prompt. ...system32\cmd.exe Though if it is started by typing "cmd" %cmdcmdline returns "cmd": Quote Microsoft Windows [Version 6.0.6000] |
|
| 8171. |
Solve : Automated Backup Batch File? |
|
Answer» I am pretty NEW to batch scripting. I would like to make a batch file to backup certain directories, to another location. Also, i would like to CREATE an output log with the details of the backup and whether it was successful or not. Finally, i would like this log to have a time stamp (begin and end, if possible a time stamp for each line entry. Below is what i have so far. THANK you. |
|
| 8172. |
Solve : Need Help Please? |
|
Answer» I run a moparscape server (see www.moparscape.org) and i need a batch file that restarts my server every 30mins can anyone help me please? |
|
| 8173. |
Solve : Batch File help please? |
|
Answer» Need a batch FILE to print an excel file to a SPECIFIC network printer with an IP address. PLEASE help |
|
| 8174. |
Solve : Browse for installation directory !? |
|
Answer» I wanna make browse script in batch file working on win xp ! UHARC comands When i merge this two scripts i recieve error ! "(choose... 1, 2, or 3) = 1 is was unexpected at this time." I dont know where is the error , all seems to be correct but dont work ! P.S. Thank you for the help ... when your script is alone in the bat file works great !You never mentioned why the merged script failed to run, but you may have some luck with this: Code: [Select]@echo off :start echo -------------------------------------------------------------------- ECHO 1. Install in current directory ! ECHO 2. Browse ! ECHO 3. Exit ! echo -------------------------------------------------------------------- set /p choice=What is your choice ? if '%choice%'=='1' goto install if '%choice%'=='2' goto loop if '%choice%'=='3' goto exit ECHO "%choice%" ERROR ... TRY 1 , 2 or 3 ! ECHO. goto start :install @UHARC.exe x -pwproject project.uha goto exit :loop echo Browse for install dir ... NOTE !!! echo -------------------------------------------------------------------- echo If the path you want to use doesn't exist echo the program will be installed in current dir echo and the folder will be automaticaly created ! echo -------------------------------------------------------------------- set /p dir=Where to install: echo %dir% set /p ans=Press Y(Yes) to install or N(NO) to choose other dir ! if .%ans%==.y goto next if .%ans%==.Y goto next goto loop :next @UHARC.exe x -t%dir% -pwproject project.uha :exit 8-) |
|
| 8175. |
Solve : Old 386 again? |
|
Answer» I have the old 386 running again thanks to help from this forum so I am back at the well again. I have copied and moved a large portion of my data but I have a set of 6 backup floppies that I would like to restore. It's been since '92 so it obviously can't be too important, but my old employer would like some of his old DRAWINGS if I can find them. The problem is I forgot to record the directory info that they were backed up from so I don't know what directory to restore to. Is there some way to restore to a default or \* directory to save me on this or should I just write them off? I'm running DOS 3.? |
|
| 8176. |
Solve : I'm not crazy? |
|
Answer» HI there, Using Google I have been trying to create a simple batch program. I'm not a programer and I know I'm not crazy either. But I think what I'm trying to accomplish can't be impossible - it's just beyond my abilities. So I'm asking for help - before I go crazy and throw myself off a bridge. I've spent the past 5 hours trying to make a batch file that will copy a .jpg to another directory and give it a new name. That part is EASY. There are variables though. The original .jpgs are pictures of people using numbers as the name. What I need is to have the picture copied to another folder with the ability to enter the persons proper name. Wait! It gets more complicated - People, for some silly reason, sometimes have more than a first and a last name. *censored* I was able to write seperate batch files for two, three and even four names and they work. But what I really want is to do it all from one batch script, select the number of names I need (2, 3, or 4), enter the original .jpg file, then enter the proper names, PRESS enter and end up back at the 'select how many names' option. Here's what I've got so far: :BEGIN @echo off set choice= set /p choice=Enter the number of names for the pictured user to continue... if '%choice%'=='2' GOTO COPY2 if '%choice%'=='3' GOTO COPY3 if '%choice%'=='4' GOTO COPY4 :COPY2 CLS set /p choice=Enter picture number: if '%choice%'=='%5.jpg' set choice=%5 set /p choice=Enter first name: if '%choice%'=='%6' set choice=%6 set /p choice=Enter last name: if '%choice%'=='%7' set choice=%7 CLS COPY %5 "C:\Den\Destination\%6 %7.jpg" etc. for the 3 names, and 4 names options. Now, the above doesnt work. It asks the questions and looks the way I want, but it won't copy the picture. It says it can't find the picture. I have no clue why, but I'm hoping someone out there does and can tell me how to fix it, please. TIA Regards, "Insane in Waterloo"KISS should be every coder's anthem. %5, %6, %7 (actually %0-%9) are command line parameters. Unless you passed them on the command line when you ran your file, they have no value whatsoever. The set /p statement takes everything input at the prompt literally. Whether someone's name is Cher or John Doe, or Edgar Allan Poe the variable takes on the value of every character typed up to the return key. In your case there is no reason to know whether someone has 1, 2 or 3 names, the variable will contain Cher, or John Doe or Edgar Allan Poe and if they are the Artist Formerly Known As Prince, well, that will all be in the variable too. 8-)Based on the reply I have modified it thustly: :BEGIN @echo off set /p choice=Enter badge number: if '%choice%'=='%1' set choice=%1 set /p choice=Enter user name: if '%choice%'=='%2' set choice=%2 COPY %1 "C:\Den\Destination\%2.jpg" GOTO BEGIN Here's how I understand the above - The first set /p choice is to ask me what the file I'm looking for is called. For example I enter 564658.jpg which will be REPRESENTED as the variable %1 The second set /p choice is to provide the new name of the file. For example I enter Jean Luc Picard which is represented as the variable %2 The final command is to copy %1 to the new folder and rename it %2 and go back to start the cycle again. I know this is obvious to people except me but this doesnt work. Anyone care to help??? Well, it's simpler but think short story instead of NOVEL: Code: [Select]:BEGIN @echo off set /p badge=Enter badge number: set /p user=Enter user name: COPY %badge% "C:\Den\Destination\%user%.jpg" GOTO BEGIN The %0-%9 variables have special meaning in batch files and cannot be used in the context you were using them. 8-)That'll work.. Thanks for making my life simple again. |
|
| 8177. |
Solve : Get month in cmd? |
|
Answer» Hey everyone Hey everyone There is a free utility program that does a LOT of date and MATH functions. Fdate http://www.ferg.org/fdate/index.html As far as I know, it works not only with MS-DOS, but with all versions of Windows command line. It is well documented, but be prepared to SPEND a few minutes reading. It has a multitude of functions, so to get the one you want, and the format you want, you have to wade through all the other STUFF. As with most anything, once you get the hang of it though, it is very easy to use. I hope this helps. |
|
| 8178. |
Solve : Hiding Batch file DOS area?? |
|
Answer» Hi all, |
|
| 8179. |
Solve : .me file? |
|
Answer» how to CREATE .me file to use in dos? |
|
| 8180. |
Solve : Reading text file in Windows 95? |
|
Answer» Hello, |
|
| 8181. |
Solve : ADD DATE TO FOLDER NAME? |
|
Answer» This probably sounds like a bit of an odd question but I am looking to add the date to a folder name with a batch file. The reason for this is so that I can have it set to a schedule to run every day. The over all TASK is to put the date onto a folder name and then the program recreates the previous folder and fills it and then the next day at the same time this script runs again and everyone is HAPPY. The problem I am having is when I use the SET %DATE% command and try add its results to the folder is tells me that the MON or TUE or what ever the day is not a valid function. Is there another way to write this? Any help would be great.
I'm not sure what that line is meant to do. LOSE it! To set a variable, you don't use percent signs. To read it you do. For example set food=eggs echo %food% Also if you want to read the value of %date%, you should not be trying to set it. Use quotes around any file, folder or path containing spaces. Quote
I was missing the "" . Stupid mistake. The entire script looks like so: REM Create sub directory CALLED \yymmdd_hhmmss REM where yymmdd_hhmmss is a date_time stamp like 030902_134200 set hh=%time:~0,2% REM Since there is no leading zero for times before 10 am, have to put in REM a zero when this is run before 10 am. if "%time:~0,1%"==" " set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% MOVE "\\PCNAME\D$\TEST" "\\PCNAME\D$\TEST%yymmdd_hhmmss%" Thanks for the help Guys/Girls --I have alot of learning to do-- |
|
| 8182. |
Solve : I want to Download/Copy? |
|
Answer» i want to download/copy a file from my server is that possible it is an HTTP:// adress based on port 80 |
|
| 8183. |
Solve : SETTING A VARIABLE THROUGHOUT ENTIRE CODE..??? |
|
Answer» THIS IS MY CODE: |
|
| 8184. |
Solve : Legacy program will not print from DOS? |
|
Answer» Hello All, |
|
| 8185. |
Solve : pre-defined variables? |
|
Answer» OKAY WELL i have had this question and I have been working around it. How do i make a pre-difined variable? like so I can type %1% and it will show what %1% is because i type %1%=Hello or somethingI have no idea what your question is, but here goes: Quote set variable=string I know thats PROBABLY not what you want but I didn't understand your question. If it's about setting variables type "set/?" in a command prompt.yeah that was pretty much it. thanxQuote from: gamerx365 on AUGUST 09, 2007, 03:04:13 PM yeah that was pretty much it. thanx |
|
| 8186. |
Solve : Running Python Script with batch? |
|
Answer» I have downloaded the Python script from Google that generates a sitemap, and I'd like to automate the process with a batch file. However, my batching skills are limited to echo and ping. |
|
| 8187. |
Solve : netsh command static ip assign? |
|
Answer» Hi Iam trying with this and cant make it to work?? Remarks: Used to change the IP address configuration mode from either DHCP toSource: Microsoft Help Command Good luck. 8-)Tanx I solved it by my self.. The right syntax and execute command should look like this ********* SET /P IP= IPADRESS? SET /P MASK= SUBNET? SET /p GW= GATEWAY? netsh interface ip set address name="Local Area Connection" source=static %IP% %MASK% %GW% 1 ********* obvious this only works if you don't have changed your Nic name... To put it back to DHCP **** netsh interface ip set address "Local Area Connection" dhcp **** And for vbs like this. *********** strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE AND index=9") IP = InputBox("Type In New IP Adress eg. 10.11.12.13", "", "Type Here") SUBN = InputBox("Type In New Sub Net Mask eg. 255.255.255.0", "", "Type Here") GW = InputBox("Type In New Gateway eg. 10.11.12.1", "", "Type Here") DNS = InputBox("Type In New DNS eg. 10.11.12.3", "", "Type Here") strIPAddress = Array(IP) strSubnetMask = Array(SUBN) strGateway = Array(GW) strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." END If Next *************** But I have trouble to make it generic "index 9" that is my Nic on this computer. I am no good @ vbs but i am getting there, i will try to list all my Nic and make a choice eg. 1 =lan ,2 =Wifi, 3=Blue tooth etc... and den run the script. I will post the solution if I can make it to work.. :-/ reg/spesseOne nice things about functions is that they return a value which you can use to your advantage: Code: [Select]strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE AND index=" [highlight]& GetIndex()[/highlight]) IP = InputBox("Type In New IP Adress eg. 10.11.12.13", "", "Type Here") SUBN = InputBox("Type In New Sub Net Mask eg. 255.255.255.0", "", "Type Here") GW = InputBox("Type In New Gateway eg. 10.11.12.1", "", "Type Here") DNS = InputBox("Type In New DNS eg. 10.11.12.3", "", "Type Here") strIPAddress = Array(IP) strSubnetMask = Array(SUBN) strGateway = Array(GW) strGatewayMetric = Array(1) For Each objNetAdapter in colNetAdapters errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) If errEnable = 0 Then WScript.Echo "The IP address has been changed." Else WScript.Echo "The IP address could not be changed." End If Next Function getIndex() Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") cnt = 0 For Each Adapter In colNetAdapters cnt = cnt + 1 strMenu = strMenu & cnt & ". " & Adapter.description & vbCrLf Next getIndex = InputBox(strMenu, "Choose The Adapter") If CINT(getIndex) > cnt Then getIndex() End Function This should prompt the user by giving a menu of adapters from which the user can choose by number. Nice script by the way. Note: You might want to do more error trapping so the user input is not too ridiculous. yeah |
|
| 8188. |
Solve : Scanner Bat? |
|
Answer» hi all, |
|
| 8189. |
Solve : can v replac multiple files(sameName) under a dir?? |
|
Answer» Hi All, |
|
| 8190. |
Solve : Call another batch file? |
|
Answer» How do I write a runall.bat batch file to RUN cmd1.bat after FINISH, it will run CMD2.bat , after it finish running cmd2 then will cmd3.bat and quit . i am using windowsxp |
|
| 8191. |
Solve : I just want to share something useful i made ;)? |
|
Answer» [highlight]@ECHO off Ya so what does it mean in English? What does ping your IP mean? Ping-A UTILITY that forwards DATA packets to check the quality of a link or verify the connection of a MACHINE to the Internet. 8-)fffreakOOOOOOOOOOOkay! thank-ya! |
|
| 8192. |
Solve : how to print from a batch file? |
|
Answer» how to print an EXCEL from a batch file? |
|
| 8193. |
Solve : empty file? |
|
Answer» How do i create a new empty file in DOS? Well actually i was hoping for something more automatic that I could use in a batch file. Suggestions? See this thread. Quote cd\>filename Works for me...echo. > filenameThat won't MAKE a blank file, that will make a file with a blank line in it. either: type nul>filename OR cd\>filename create zero-byte files. |
|
| 8194. |
Solve : bat problem..think %username% isn't getting complete name...? |
|
Answer» My apologies if this subject has been covered. I have tried USING the search, as well as drilling through many of the forum pages, but I just haven't seen an answer to what I need. I am not very experienced in DOS and batch files |
|
| 8195. |
Solve : Little help with small script? |
|
Answer» Okay, I need a little help figuring out why this isn't working. The probem is no matter what the VAR outlook always gets set to 2003. The PC i'm testing on has only office 2K installed. I have confirmed that the errorlevel is retruned correctly (errorlevel=1) so I can only presume that the problem lies in the else statement. I dunno it looks right to me. Any ideas? |
|
| 8196. |
Solve : Need a Variable to Specify the Drive that the OS is installed onto..??? |
|
Answer» is there a variable i can use to specify the drive that the OS is installed onto..?? |
|
| 8197. |
Solve : APPLICATION START BEING RAN FROM THE WRONG PLACE..??? |
|
Answer» i have an BATCH file that i turned into an .EXE named 1.EXE on a removable USB Drive at F:\ and its code is: THANX AGAIN CONTREX... Gumbaz, that's what i like about DOS & command prompt, there's usually a simple answer out there somewhere. Always glad to share... |
|
| 8198. |
Solve : Keep latest 2 files and delete the rest? |
|
Answer» I have the following: |
|
| 8199. |
Solve : Running a batch file at startup? |
|
Answer» ive read the TUTORIALS on this site but i still cant get my batch file to AUTORUN on startup. Can ANYONE please give me a specific, step by step instruction manual for this plz? THANKYOU so much.Try placing a SHORTCUT to the .bat file in the all users/startup folder.Quote from: 2k_dummy on August 12, 2007, 11:39:47 AM Try placing a shortcut to the .bat file in the all users/startup folder. Agreed. |
|
| 8200. |
Solve : Can this be done when creating a DOS Batch File? (please help!)? |
|
Answer» Hello everyone and thank God that this site exists,I was overviewing this forum for an answer to this problem and saw some posts and responses that came close to what I was after yet I didnt find anything exactly what I was looking for.What I am trying to accomplish is this: I am creating a batch file and was wondering if it (or can it?) be possible to "program in" a command in a batch file that would reboot your computer then "resume" to the next LINE where you left off in your batch file after the reboot step command in a batch file? An example of this would be say that there are 12 steps in your batch file and at the entry where it reboots say at step 7,is there a way where it can resume to move on to step 8 (the next step) where it left off at after it reboots? Another example of what I mean here is that we all know that after partitioning a hard drive we have to "reboot" before you can enter the "format c:" command and then continue from there.I want to be able to create a batch file to go through all 12 steps including a reboot and then resume out the rest of the commands. The idea here is to create a totally "unattended batch file" where all commands can be entered in automatically (including rebooting if need to) from beginning to END and I wasnt sure if this COULD be done or not so I thought I would ask,thanks in advance to everyone out there for helping me out! Have a great weekend! - Mike Hello! I would think that it would be very possible for this to happen, here are my thoughts ... Firstly get the code to restart your computer from a batch file, I don’t have it off hand, but I have seen people post it before; it will probably be on this forum or a 5 min Google SEARCH away. Next you need to sort out the first part of your batch file, the bit before the restart, at some point inside it you are going to have to create another batch file (the SECOND logical half) and copy it to the 'C:\Documents and Settings\Administrator\Start Menu\Programs\Startup' (or similar) folder (before the restart!), then when you do restart your computer, this second logical half will start off and finish the job, don’t forget to delete it from the startup folder after though (just write it into your file) Hope that helps!? Or at least starts you off on your travels? BoB |
|