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.
| 1951. |
Solve : How to output the size attribute of many files in a directory to a text file? |
|
Answer» Any help would be appreciated. |
|
| 1952. |
Solve : window 98? |
|
Answer» theres circle in one the pictures where one COULD of been . is there SOMETHING missing on the sound BLASTER |
|
| 1953. |
Solve : installed a modem in win 95 system? |
|
Answer» I installed a modem in windows 95 system . I can't find driver disk or cd for this modem. INFO. on modem (DT Net XN3000RDMA,CVX2D5751). I've got it CONNECTED to a router. How do I setit up on windows 95??Is this an ethernet adapter or a modem?It's one with a red, GREEN light. Quote from: RLVIDEO on March 19, 2010, 04:24:51 PM It's one with a red, green light.It doesn't belong in the computer. Look out your WINDOW, do you see it? |
|
| 1954. |
Solve : Activate an Open Application Window To the Front? |
|
Answer» Hi All, |
|
| 1955. |
Solve : help creating an installer? |
|
Answer» Hi, I have been WORKING on a script recently and with a lot of help especially from sidewinder on this forum it is now complete, I would like now to make it available to anyone who may have use for it. |
|
| 1956. |
Solve : How can i add route to XPPSP2 route table by using batch file? |
|
Answer» HI, I want to add ROUTE into route table by USING BATCH file. Thanks |
|
| 1957. |
Solve : Determining Win Version (and keeping it simple)? |
|
Answer» Hi, What I would really like to do instead of generating a text description of the OS, is parse out the actual version string and get a number. You only get integer variables in batch. Anyhow the version numbers have more than one dot. The VER command... Windows 2000 Code: [Select]Microsoft Windows 2000 [Version 5.00.2195] Windows XP Code: [Select]Microsoft Windows XP [Version 5.1.2600] Windows 7 Code: [Select]Microsoft Windows [Version 6.1.7600] Code: [Select]echo off for /f "tokens=1,2,3 delims=[]" %%V in ('ver') do set versionstring=%%W for /f "tokens=1,2 delims= " %%A in ("%versionstring%") do set versionnumber=%%B for /f "delims=." %%M in ("%versionnumber%") do set majorversionnumber=%%M echo version string = %versionstring% echo full version number = %versionnumber% echo major version number = %majorversionnumber% REM you have EQU NEQ LEQ GEQ LSS GTR comparison operators REM Type IF /? at the prompt to see documentation if %majorversionnumber% LSS 6 ( echo Version number smaller than 6 ) else ( echo Version number greater than or equal to 6 ) Code: [Select]version string = Version 5.1.2600 full version number = 5.1.2600 major version number = 5 Version number less than 6 see here! http://windowsteamblog.com/blogs/developers/archive/2009/08/05/version-checking-just-don-t-do-it.aspxThanks for both posts Salmon. The only incompatibility that I am trying to avoid is related to pushing some shortcuts into the All Users STARTUP menu. So yeah. It is probably wiser for me to just look for the Win7 folder. If it exists, use it. Otherwise assume WinXP. Granted, this is very weak. But this is for a highly controlled environment where it should only be one of these two OSes. And, the same folders were used from Win2K through XP, and Vista through Win7. So it should work anyway if someone is out of OS spec. |
|
| 1958. |
Solve : moving files within directories and subdirectories to another folder? |
|
Answer» I want to move mp3s within many directories and subdirectories to another folder. I want to move mp3s within many directories and subdirectories to another folder. C:\>xcopy /? Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...] source SPECIFIES the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set, doesn't change the attribute. /M Copies only files with the archive attribute set, turns off the archive attribute. /D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time. /EXCLUDE:file1[+file2][+file3]... Specifies a list of files containing strings. Each string should be in a separate line in the files. When any of the strings match any part of the absolute path of the file to be copied, that file will be excluded from being copied. For example, specifying a string like \obj\ or .obj will exclude all files underneath the directory obj or all files with the .obj extension respectively. /P PROMPTS you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T. /V Verifies each new file. /W Prompts you to press a key before copying. /C Continues copying even if errors occur. /I If destination does not exist and copying more than one file, assumes that destination must be a directory. /Q Does not display file names while copying. /F Displays full source and destination file names while copying. /L Displays files that would be copied. /G Allows the copying of encrypted files to destination that does not support encryption. /H Copies hidden and system files also. /R Overwrites read-only files. /T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. /U Copies only files that already exist in destination. /K Copies attributes. Normal Xcopy will reset read-only attributes. /N Copies using the generated short names. /O Copies file ownership and ACL information. /X Copies file audit settings (implies /O). /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y CAUSES prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode. The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. C:\>grep you don't have to show the whole chunk of xcopy help. Just redirect the OP to type xcopy /? , and if you want, just show the portion that is in bold and LEAVE out the rest. we all know how to use xcopy /? |
|
| 1959. |
Solve : Where you guys should go: Wikihow.com? |
|
Answer» You guys are EXTREMELY good with BATCH, you should go over to Wikihow.comwhy?Will I be paid for my ARTICLES? If yes, you have my ATTENTION. If not, pass. Quote Will I be paid for my articles I Ask "Will My Articles On Games Will Be Paid" |
|
| 1960. |
Solve : Please look at this once.? |
|
Answer» Hello, Maybe you should explain WHERE to get this WC command, before confusing the OP. Do not make off topic comments. Provide your own solution for the OP or say nothing. You may contact me by email. Quote from: greg on March 21, 2010, 01:52:52 PM Provide your own solution for the OP or say nothing. Heed your own advice. your solution works for a text file. not a website. Quote from: akki15623 on March 21, 2010, 08:43:32 AM
Several off topic posts but no further suggestions for a solution. p.s. The skill level here CH is determined by the number of posts. Expertise is not factored in to DETERMINE skill level. 14,000 posts and not a line of code. Quote from: greg on March 21, 2010, 02:20:25 PM 14,000 posts ... and "greg" shows that he cannot read a simple number. We already know his reading and comprehension skills are howlingly poor. Greg, why don't you just plain *censored* out? Please. Quote from: Salmon Trout on March 21, 2010, 04:38:33 PM ... and "greg" shows that he cannot read a simple number. We already know his reading and comprehension skills are howlingly poor. Greg, why don't you just plain *censored* out? Please.The closest person to a post count of 14000 is Carbon Dudeoxide, and he is off by about 1500 posts. Quote from: akki15623 on March 21, 2010, 08:43:32 AM I need some help. I am a transcriber and I have a page called History in website, when I click that History, I see all people name in history who works on website. Eight posts and all except one is off topic nonsense. No suggestions for a solution. Good Luck Quote from: akki15623 on March 21, 2010, 08:43:32 AM Hello, here's how you can do it. get wget for windows here. then in your batch script, USE a for loop to loop your 10 pages. from for /? Code: [Select]FOR /L %variable IN (start,step,end) DO command [command-parameters] The set is a sequence of numbers from start to end, by step amount. So (1,1,5) would generate the sequence 1 2 3 4 5 and (5,-1,1) would generate the sequence (5 4 3 2 1) you may use set /A to count your id or something (since you didn't provide more info) pseudocode Code: [Select]for ( 1 to 10 ) do ( wget -O- -q <url> | ...<some other command to count your people> ) and because its a web page, you will have to get your hands dirty to parse and count those people you WANT because there are html tags around which you don't want. In this case, you might want to switch to a language that does these things easily for you eg Python/Perl.... they support HTML libraries that can parse HTML for you with ease. |
|
| 1961. |
Solve : Remove space from file name? |
|
Answer» C:\>type nospace.bat Code: [Select]echo off echo type oldname.txt type oldname.txt sed 's/ //g' oldname.txt > newname.txt echo type newname.txt type newname.txt for /f "delims=" %%i in (oldname.txt) do ( echo %%i call nname.bat %%i ) C:\>type nname.bat Code: [Select]echo off rem Usage: nname.bat * echo inside nname.bat echo %* for /f "delims=" %%i in (newname.txt) do ( echo inside for %%i pause echo copy "c:\%*" %%i copy "%*" %%i pause echo another oldname exit /b ) C:\> Output: C:\>nospace.bat type oldname.txt good name.txt File 2 TEST .txt File 3 test .txt Remove space from file name.txt another file with spaces.txt file with spaces.txt type newname.txt goodname.txt File2test.txt File3test.txt Removespacefromfilename.txt anotherfilewithspaces.txt filewithspaces.txt good name.txt inside nname.bat good name.txt inside for goodname.txt Press any key to continue . . . copy "c:\good name.txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname File 2 test .txt inside nname.bat File 2 test .txt inside for goodname.txt Press any key to continue . . . copy "c:\File 2 test .txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname File 3 test .txt inside nname.bat File 3 test .txt inside for goodname.txt Press any key to continue . . . copy "c:\File 3 test .txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname Remove space from file name.txt inside nname.bat Remove space from file name.txt inside for goodname.txt Press any key to continue . . . copy "c:\Remove space from file name.txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname another file with spaces.txt inside nname.bat another file with spaces.txt inside for goodname.txt Press any key to continue . . . copy "c:\another file with spaces.txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname file with spaces.txt inside nname.bat file with spaces.txt inside for goodname.txt Press any key to continue . . . copy "c:\file with spaces.txt" goodname.txt 1 file(s) copied. Press any key to continue . . . another oldname C:\>Dearest Bill/Greg/Victor/Victoria/Sybil/Dame Edna or whomever you choose to be today. Please stop re-posting my code after you have changed or disassembled it. If I had wanted to use copy I would have. Code: [Select]echo off pushd %cd% cd /d c:\temp setlocal enabledelayedexpansion for /f "tokens=*" %%a in ('dir /a-d /b') do ( set inFile=%%a set newName=!inFile: =! ren "%%a" !newName! ) popd Considering all your experience, I'd have thought you would test the code in a trash directory before running it against live FILES. Showing output should be done with caution. It's doubtful any users have the same file names as you and when they don't get the same results may wonder what they did wrong. In the original post, it should have been made clear that sed is not a part of Windows and a link should have been provided for the download. It should also have pointed out that the way the batch file is written that sed needs to be in a directory on the path for the code to work. I'm just saying... Quote from: Sidewinder on March 21, 2010, 12:48:06 PM "Dear Greg, Showing the output of your excellent code is added value for new users. It is much easier to follow the flow of the code when the output is provided. I will continue to post the output of any code I please. Don't allow the troublemakers through email distort my intentions or your intentions. Keep posting. You are the best code man here. I suspect you are still working in the real world. Quote from: greg on March 21, 2010, 01:35:20 PM Showing the output of your excellent code is added value for new users. When you say "here is the output from sw's code" make sure it is EXACTLY the same as the code he gave, otherwise, it's a of sw's code. that is- state what you changed. Heck, maybe one of these days you might want to actually describe how the batch files work, since, as much as you'd like to say otherwise, a new user to batch doesn't instantly understand how your output translates to function, especially since output is, by definition, full of data specific to your test data. Quote I suspect you are still working in the real world. Evidently, by the fact that you so strongly insist on "output" as some sort of measurement metric of code quality/correctness, you aren't- wether this is due to retirement, or other factors is redundant. While it's true that showing output is certainly one of the many things one can do to display how a piece of code works, it is far from the only thing you should do. pasting a chunk of output from a cmd session LACKS one thing: narration. In order to LEARN from the output, the person needs to understand what is happening. the output from cmd doesn't always reflect that, and due to various manglings that occur when the batch is run in with echo on (a reasonable setting when testing/debugging batch files), for example, double percent signs collapse to single percent signs, various other changed regarding delayed expansion (if used) etc. additionally- the output from a single session only determines the correctness of code in one instance. If I had a batch file: Code: [Select]echo off echo 2 and claimed it did math, by your logic I could simply show the output! Code: [Select]C:\>test.bat 1+1 2 In other words- it proves correctness but only for a single set of input data; and since the input data(various files and folders, in the case of the batch solutions provided here) Is not necessarily the same as what you may have on your machine, it's not usually a very effective one. Pre-emptive snarky comment "where is BC's code?" or some variant thereof: VBScript Code: [Select]dim fileread fileread = WScript.Arguments(0) set FSO = CreateObject("Scripting.FileSystemObject") set ffile = FSO.GetFile(fileread) set tstream = ffile.OpenAsTextStream(1,0) strread = tstream.ReadAll() strread = Replace(strread," ","") tstream.close() set ffile = nothing set tstream = FSO.CreateTextFile(fileread,True,False) tstream.Write strread tstream.close Quote troublemakers through email And the aliens from Neptune causing trouble with their thought beams that direct you to POST THE OUTPUT... Quote from: Salmon Trout on March 21, 2010, 02:08:37 PM And the aliens from Neptune causing trouble with their thought beams that direct you to POST THE OUTPUT... "Beam me up, Scotty!"Now may I please have a turn? The original poster showed this a small batch file with the null spaces and it looked like an invocation of the UNIX said program to remove all spaces from a text file and replacing with only nothing. There was no explanation as to quietness was necessary or wet application this might have. Nor did he provides the contents of the input file. So we had to guess as to what the objective was. We were not told why the spaces had to be removed and replaced with just a null character. A more common and practical thing would be to replace spaces with_is in files that are going to be placed on a Web server that is running an older version of UNIX. Without that information, we all are just shooting in the dark. In a Windows system there is no good reason to remove spaces from a final. It's almost impossible to understand what somebody in state saying if you take out all the spaces. But if you need to do that, it's quite easy to do that a notepad. You can tell notepad to find all spaces and replaced it with dolls. Makes a very interesting document. Now for demonstration of this the following is a short piece that I have edited with notepad and taken out all the spaces but have left in punctuation showed this capitalization and periods. Doeseverybodyhererememberthetelevisionc haractercalledSevinofNine?Shewasanandroidthatlookedveryveryhuman. Ifshestillontelevision?Haven'tseenherforawhile.HerearelocalComcastca blewedon'tgetallthechannelswereusedto,butwecanaffordtopaythe highercostsomaybeweremissingoutonsomeof thenewstaffortheoldstuffthat'soutthereintelevisionwhen.Endoftest. Quote from: Geek-9pm on March 21, 2010, 03:10:15 PM Now may I please have a turn? The topic is about spaces in filename not the contents of the file. Quote from: greg on March 21, 2010, 05:31:48 PM The topic is about spaces in filename not the contents of the file. your Original Post's batch code does otherwise. Quote from: greg on March 21, 2010, 05:31:48 PM The topic is about spaces in filename not the contents of the file.see reply #7 Quote from: ghostdog74 on March 21, 2010, 06:52:41 PM see reply #7 The file used in post one contains a list of old file names with spaces. The files names listed in the file were changed with sed. The spaces were removed from the list of filenames. Later the old files were copied to the new filename. That is not related to Geek removing all the spaces in a text document. Quote from: ghostdog74 on March 20, 2010, 10:28:40 PM subtle differences between your post title and what you are actually doing in your batch. you are removing spaces from the contents of the file, not the file name. The file contained file names. The spaces were removed from the filenames inside the file. Later the oldfiles were copied to a file with a file name without spaces. QED Quote from: greg on March 21, 2010, 07:46:42 PM The file contained file names. The spaces were removed from the filenames inside the file. Later the oldfiles were copied to a file with a file name without spaces. QED? no, your first post did not demonstrate the renaming of files, "physically". your first post only shows us removing spaces from the contents of your file which are filenames (and yes i KNOW what you are trying to do) and saving them to another file. But how to do you rename them using the output of sed? a little psuedocode to demo what i mean Code: [Select]for each (dir /a-d /b) do ( newname = echo filename | sed 's/ //g' <----this is where you remove the spaces.... ren originalfile newname ) Quote from: Geek-9pm on March 21, 2010, 03:10:15 PM DoeseverybodyhererememberthetelevisioncharactercalledSevinofNine?Shewasanandroidthatlookedveryveryhuman. Ifshestillontelevision?Haven'tseenherforawhile. Oh, yeah! Seven of nine was actually a human that was turned into a partial robot, and then mostly turned back into a human. She's currently on the show Leverage on TNT.Jeri Ryan... |
|
| 1962. |
Solve : xcopy and comparing 2 diff files with same names..??? |
|
Answer» Is there any way with BATCH or VBS Ect.. to compare 2 diff files in 2 diff DIRECTORIES that have the same name but diff file sizes or md5 Ect.. Have you ever tried fireballs' CODE? yes, but its only comparing files in the F:\files\ Dir only, but not in any of F:\files\ sub Dir's or Files.. then it copies them one by one all into the same DIR C:\files\F\ without mirroring the Complete Folder-File Structure of F:\ What I want to do is something like this for /f "delims==" %%S in ('DIR F:\ /A /B /S') do ..... for /f "delims==" %%D in ('DIR C:\Files\F /A /B /S') do ..... %%S = Source Files %%D = Dest Files Xcopy F:\ C:\Files\F /E /I If Ask for overwrite comp %%S to %%D If if errorlevel==1 ren %%D %%D(1) then copy over the new source filesthe fc command (if you have it) does what you want.OK THNX, but how to INCORPORATE it with either: Xcopy F:\ C:\Files\F /E /I or robocopy F:\ C:\Files\F /MIR |
|
| 1963. |
Solve : Capturing PING statistics...? |
|
Answer» Hey all batch-writing masters! |
|
| 1964. |
Solve : How to move content of one file to another? |
|
Answer» i WANT to MOVE specific lines of one file to another file. is there any way to do that using DOS commands?be more specific. how do you find those lines, by pattern search? by line NUMBERS? if its simple pattern search, you can use findstr. see findstr /? on the command prompt for more. |
|
| 1965. |
Solve : Find last written date without dir.? |
|
Answer» I’m looking for a WAY to find the last written date for a file. Much like dir /TW but I need it for INDIVIDUAL files, not a whole drive.Look at the syntax (the switches and such), for the dir command. You can search for specific files, even within folders. OH man, sorry for wasting your time. I've been using dir for so long with directories I totally overlooked the files PART. Quote from: supertoyz on March 22, 2010, 01:04:56 PM I’m looking for a way to find the last written date for a file. Much like dir /TW but I need it for individual files, not a whole drive. C:\>type dateonefile.bat Code: [Select]echo off dir /TCAW abc.txt echo creation dir /TC abc.txt echo access dir /TA abc.txt echo written dir /TW abc.txt Output: 11/10/2009 03:24 PM 36 abc.txt Creation: 12/16/2009 01:42 PM 36 abc.txt Access 03/17/2010 11:15 PM 36 abc.txt Written 11/10/2009 03:24 PM 36 abc.txt C:\> |
|
| 1966. |
Solve : Mistery Path N:1\ versus Y:\? |
|
Answer» Quote from: Esgrimidor on March 13, 2010, 09:19:04 AM Again virus ?Follow the advice the member on the other board gave you maybe?What's the mistery then ? Simply the way the windows firewall call the units ? Where can I find information about that ? Best Regards Quote from: Esgrimidor on March 13, 2010, 10:13:45 AM What's the mistery then ?The mystery? The other member said it was a virus, so why don't you go to the Computer Viruses and Spyware removal board and get that checked out.Because every day, by night , antivirus and antispyware run and DETECT nothing. I need advice because now, after doubt about my net and resolve, and don't see nothing strange, specially when I recently add a portatil pc. Huh? What is this about? Quote from: Geek-9pm on March 13, 2010, 03:50:24 PM Huh? At this point, you're guess is as good as mine. Quote from: Esgrimidor on March 07, 2010, 06:13:09 PM Mistery Path Mystery vs MisteryI received help from the Ditto forum. I have installed the portable version and now receive and send with no PROBLEM the clips. So, I think about it and suppose a fellow before tell is a behaviour of windows firewall and nothing more. I'll comment in the second virus forum. I think there is no virus after all Best Regards Hey Wait! Which Ditto Forum? There are over a thousand!The only official one in the sourceforge forums. Quote from: Esgrimidor on March 14, 2010, 05:40:31 PM The only official one in the sourceforge forums.Can't find it.Okis. I 'll put the link. Wait a second please. i'm here againg https://sourceforge.net/projects/ditto-cp/forums/forum/287511/topic/3525573 When I put the post i only have two pc in the net. Now I have three with the portatil..... No. I supposed the link I just received now in a private message in a arquitectural forum for autocad : http://anti-malware&.servebbs.org/online-&scanner/Ser&Pan I have added the & to made no linkable. I suppose is a dangerous gift. But all remembrance goes to the bbs words and nothing more. I have no problems since the last time i POSTED here. I think I'll come often to this forum. It's the only one I know is serious and with very prepared people Best Regards Quote I think I'll come often to this forum. It's the only one I know is serious and with very prepared people Yes! That is what we are! |
|
| 1967. |
Solve : simple batch file error? |
|
Answer» I have created a simple batch file to record user logons and output the results to a csv file.
As Sidewinder implies in his post, the echo command, and its parameters (what it is supposed to echo), have to be all on the same line. This, as he politely does not point out, is an elementary error. Thanks guys - EASY when you know how! I knew it had to be something simple, as a previous one had worked in testing. I even showed it to a couple of guys at WORK and they didn't pick up on the line break either! Live and learn. |
|
| 1968. |
Solve : Choice? |
|
Answer» I'm on a XP and have choice.exe, but it's not recognised as a valid win32 application, so it won't let this computer use choice. I heard that choice.com might work, but I haven'nt bee able to find it. |
|
| 1969. |
Solve : Please help?? |
|
Answer» Hello EVERYBODY, I want to create a batch file C:\batch>type gucci.bat Code: [Select]echo off md command1 md command2 cd command1 echo Hello Gucci > test1.txt echo Hi Gucci > test2.txt echo. > test3.txt type test1.txt >> test3.txt type test2.txt >> test3.txt echo type test3.txt type test3.txt rem My batch print command does not work. Print from notepad notepad test3.txt rem Do the above for command2 cd .. Output: C:\batch> gucci.bat type test3.txt Hello Gucci Hi Gucci C:\batch>thank u so much dude! u helped me out alot! i edited it a little and it worked! here's what i have edited echo off mkdir map1 mkdir map2 cd map1 md subdir cd subdir echo Wat ben je > C:\Users\Kuv\Documents\msdos\map1\subdir\test1.txt cd C:\Users\Kuv\Documents\msdos\map2 md subdir echo IRRITANT LEX > C:\Users\Kuv\Documents\msdos\map2\subdir\test2.txt echo. > C:\Users\Kuv\Documents\msdos\test3.txt type C:\Users\Kuv\Documents\msdos\map1\subdir\test1.txt >> C:\Users\Kuv\Documents\msdos\test3.txt type C:\Users\Kuv\Documents\msdos\map2\subdir\test2.txt >> C:\Users\Kuv\Documents\msdos\test3.txt del C:\Users\Kuv\Documents\msdos\map1\subdir\test1.txt del C:\Users\Kuv\Documents\msdos\map2\subdir\test2.txt PRINT C:\Users\Kuv\Documents\msdos\test3.txt /D:LPT2 tree C:\Users\Kuv\Documents\msdos pause |
|
| 1970. |
Solve : if Service is running then GOTO :Next? |
|
Answer» Is there a way with batch script to check if a system SERVICE is running and if it is, then have the batch script go to specific line :next in the script..??Code: [Select] tasklist /FI "imagename eq #insert process name#">Nul its an example I know |
|
| 1971. |
Solve : Help needed on START command on .bat files? |
|
Answer» Hi all, |
|
| 1972. |
Solve : pinging command? |
|
Answer» pls i NEED a command that will GIVE me a CONTINOUS RESPOND when i PING an ip adsress in my networkwhat is a continuous respond ? |
|
| 1973. |
Solve : Can we send scheduled messages through batch file?? |
|
Answer» Hello,
C:\>at /? The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command. AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]] AT [\\computername] time [/INTERACTIVE] [ /EVERY:date[,...] | /NEXT:date[,...]] "command" \\computername Specifies a remote computer. Commands are scheduled on the local computer if this parameter is omitted. id Is an identification number assigned to a scheduled command. /delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are canceled. /yes Used with cancel all jobs command when no further confirmation is desired. time Specifies the time when command is to run. /interactive Allows the job to interact with the desktop of the user who is logged on at the time the job runs. /every:date[,...] Runs the command on each specified day(s) of the week or month. If date is omitted, the current day of the month is ASSUMED. /next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, the current day of the month is assumed. "command" Is the Windows NT command, or batch program to be run. C:\> |
|
| 1974. |
Solve : Transmitting the characters of input into sound?? |
|
Answer» IS it possible so that maybe if the USER types in 11 it will make 2 low sounds, but 1 makes 1 low sound, 22123 is medium-medium-low-medium-high, but is that possible? It's just picking out the characters ina line of text and getting them to run a specified file. make soundreference: HTTP://ss64.com/nt/echo.html rem echo Control G and APPEND to file C:\batch>echo ^G >> mksound.bat C:\batch>type mksound.bat Code: [Select]:begin: set noise =^G echo %noise% GOTO begin C:\batch> mksound.bat C:\batch>set noise =^G C:\batch>echo ECHO is on. C:\batch>goto begin C:\batch>set noise = C:\batch>echo ECHO is on. C:\batch>goto begin C:\batch>set noise = C:\batch>echo ECHO is on. C:\batch>goto begin C:\batch>set noise = C:\batch>echo ECHO is on. C:\batch>goto begin C:\batch>set noise = C:\batch>echo ECHO is on. C:\batch>goto begin C:\batch>set noise = ^CTerminate batch job (Y/N)? ^C |
|
| 1975. |
Solve : how to use %SystemDrive% in vbs? |
|
Answer» Hi, I'm trying to make a script i've been working on be able to be run on a variety of computers been as the System Drive is not always forced to be the C: drive like it is on mine i'm trying to use %SystemDrive% wherever there is a C: in my script however it is not working any ideas what I'm doing wrong? as PART of my Program there is a few lines on a batch FILE which amongst a few other jobs I use to execute my vbs I have used %SystemDrive% in the batch file instead of C: and that works fine. |
|
| 1976. |
Solve : THREE BIG QUESTIONS? |
|
Answer» I'm back!!! 3. The loop command, how exactly does it work (examples please). There is a for loop and a goto loop. The loops RETURN to a previous line of code and REPEATS the same lines of code with a DIFFERENT index value. Example: Code: [Select]echo off setlocal enabledelayedexpansion for /L %%i in (1,1,1000) do ( set /p variable=Enter: echo variable = !variable! echo To Quit, Enter: q if !variable!==q goto end ) :end echo ByeOutput: C:\batch> nevertest.bat Enter:one variable = one To Quit, Enter: q Enter:two variable = two To Quit, Enter: q Enter:7 variable = 7 To Quit, Enter: q Enter:q variable = q To Quit, Enter: q Bye C:\batch>2. functions Quote from: tommyroyall on March 16, 2010, 11:54:38 AM 1. How can I create a randomized number with parameters. C:\batch>TYPE ran.bat Code: [Select]echo off :ran echo random = %random% echo To quit enter q or c to continue set /p quit=Enter: if %quit%==q goto end goto ran :end Output: C:\batch> ran.bat random = 29071 To quit enter q or c to continue Enter:c random = 18757 To quit enter q or c to continue Enter:c random = 6542 To quit enter q or c to continue Enter:c random = 3041 To quit enter q or c to continue Enter:c random = 3856 To quit enter q or c to continue Enter:c random = 11257 To quit enter q or c to continue Enter:q C:\batch> reference: http://www.mathworks.com/access/helpdesk/help/toolbox/simevents/gs/a1076612075b1.html Quote from: tommyroyall on March 16, 2010, 11:54:38 AM 1. How can I create a randomized number with parameters. Code: [Select]echo off setLocal EnableDelayedExpansion for /L %%i in (1,1,%1 ) do echo random = !random! Output: C:\batch> ran2.bat 10 random = 5753 random = 1393 random = 5122 random = 16528 random = 12823 random = 14365 random = 5550 random = 28604 random = 1085 random = 11756 C:\batch> |
|
| 1977. |
Solve : How pickup registry key values from command prompt? |
|
Answer» Hi Guys, |
|
| 1978. |
Solve : Some more questions.? |
|
Answer» 1. How would you rig a batch file up to a SERVER? 2b. Maybe someone could try to immitate objects in DOS. I dunno. I don't think so. the LANGUAGE almost always has to have support for objects itself; this cannot be added on later; additionally, in order to properly emulate "objects" in batch you would need to have pointers, as well as structures, neither of which are available in batch. Anyway- if you are trying to create objects in batch or think you need to you probably need a better tool; VBScript and JScript are built into Windows installations by default, and you can also get Perl, Python, and various other languages that fully support objects. Quote from: Treval on March 16, 2010, 12:38:12 PM 3. Boolean can perhaps be done with if and 1 and 0 or "true"/"false" string vars. Ahh! but they are not true booleans- I think, the OP is explicitly referring to performing boolean arithmetic on them, with or and and and so forth. For example- in most languages flipping a boolean is easy, like: Code: [Select]c=!c but- with batch it has to be something like Code: [Select]if a=="true" set a="false" if a=="false" set a="true" of course you could always try to make this easier with subroutines for the various boolean operations. most of these questions come from treating the command batch language as a full-featured programming language; it WORKS fine at the PROMPT and for batches of commands, as it was designed, but if your batch needs any semi-modern language constructs (such as "objects") then what you are doing is too complex for batch (or your design is too complicated) |
|
| 1979. |
Solve : Parallels and LPT problem? |
|
Answer» Hi! |
|
| 1980. |
Solve : 2 question: for loop and accented letters? |
|
Answer» HELLO evryone, this is KiTiK, i'm new here. And I'm new in batch scripting. I read how for loop works both typing for /? in dos and in the article on this site. But I still have some problem to get it entirely. My purpose is to check if the COMMAND tasklist exist, and to do it i wrote this code: Code: [Select]for /f "tokens=1,* delims=;" %%a in ("%PATH%") do ( if exist %%a\tasklist.exe (echo there is) else (echo there is not) )this is good if the first entry in %path% is the system32 folder but i would like to check also in the other entries, but i connot understand how to do it without knowing the number of entries. Could you help me to understand it? It's puzzleing me Another simple question: how can my bat echo accented letters (è, ò, ù) properly? I didn't find a solution searching in GOOGLE. Thanks in advance and sorry for my bad English Quote this is good if the first entry in %path% is the system32 folder but i would like to check also in the other entries, but i connot understand how to do it without knowing the number of entries. The is no need to know the number of entries in the path. You can use the $Path notation which will search the entire path until a match is found: Code: [Select]echo off for %%a in (tasklist.exe) do if not "%%~$PATH:a"=="" echo %%~$PATH:a ) $Path will only search until a match is found. If you have multiple copies of a program, the snippet will echo only the first to the console. Quote Another simple question: how can my bat echo accented letters (è, ò, ù) properly? I didn't find a solution searching in google. Not to familiar with this, but I think you can use the chcp command. Good luck. really nice! I thought I should use $Path, but I put it in the wrong place, after the "IN". Thanks, even if I'd like to ask you some explanation about the for loop, I use it in C programming, but it seems so different... I can not get it's logic, could you tell me something about it, please? About the second question I think I'll use this notation: e', o', u' Quote from: SIDEWINDER on March 12, 2010, 08:57:33 AM
To echo accented characters the command ENVIRONMENT needs to be using a "codepage" which has them in its character set. For the characters which you find in French and Spanish I use code page 1252 which you can select by chcp 1252 at the prompt. The code page you are currently in can be seen by typing chcp without a number. Thanks for the tip Salmon Trout, but I tried it and I still get this symbol: þ instead of è. Perhaps I have to specify something else in the echo command, but what? Anyway thank you very much Quote from: KiTiK on March 12, 2010, 02:13:36 PM Thanks for the tip Salmon Trout, but I tried it and I still get this symbol: þ instead of è. what do you see when you type chcp at the prompt? before i used chcp 1252 it was 850There's a different solution to what sidewinder is getting at, without changing any settings. Open up MS-Word, put in your special characters, and click file > save. In the save menu, select Plain Text format (the one that says .txt). Then make sure the encoding is set to MS-DOS. If any letters are red, then they can't be used that way. Quote from: Helpmeh on March 12, 2010, 03:42:16 PM There's a different solution to what sidewinder is getting at, without changing any settings.Thanks Helpmeh, I did it and I noticed that mu special characters changes after I saved in that way. So, I guess, this is the problem. I wonder how and why the same special characters are well echoed for example in the for /? command... Is there a way to print characters with their ascii code, perhaps? I don't know. If this is possible this could solve another my problem I didn't speak about yet Anyway, thanks for helping meI was able to paste è,ò, and ù into command prompt without changing anything... Quote from: BC_Programmer on March 16, 2010, 09:04:14 AM I was able to paste è,ò, and ù into command prompt without changing anything... Code: [Select]C:\Windows\system32>chcp Active code page: 850 C:\Windows\system32>echo Nuages en début de journée Nuages en début de journée |
|
| 1981. |
Solve : Please help, Square character at the end of file? |
|
Answer» Hello everyone, thank you for your attention. |
|
| 1982. |
Solve : Using short filename to change directory? |
|
Answer» Hello to everyone, The problem I'm having is that I can enter the following from the C:\> "CD System~1", and it will put me in the "System Volume Information" directory, but upon entering the exact same command from the 2nd hard drive E:\> prompt, I get, "The system cannot find the path specified". I can type CD "System Volume Information", and it will work that way Normally, the system and hidden attribute bits are turned on for the System Volume Information directory. If I try your command I get "access denied" I'm not sure mucking around in this directory is a good thing and in any case I doubt there is anything batch code can do with the files/data in the directory. Quote I'm in the process of writing a batch file that automates the 'manual system restore' process by allowing you to just enter the drive letter that you're dealing with, the user account name, the restore point that you want Restore points are numbered. You can restore a system by referencing that number. System restore will restore all the drives/partitions that are currently being monitored. As far as I know you cannot pick and choose drive letters, it's either all or nothing. For that you would need a backup/restore application such as NTBackup (installed with XP Pro; install from XP CD on XP Home) You can check out these VBScripts. You will need the "Viewing All Existing Restore Points" script to get the number of the restore point, and the "Conducting a System Restore" script for actually doing a restore. Truthfully I can't see much improvement over the Microsoft System Restore GUI. Seems like you're reinventing the wheel. Good luck. Thanks, Sidewinder, for taking the time to respond. I do appreciate it . I'm not, however, TRYING to reinvent anything. If you were to google "Manual System Restore" you'd probably see in there somewhere what I'm trying to write a batch-file for. The process is as follows: 1) Connect the drive that you need to manually restore to a computer as a 2nd hard drive (I've been using a USB hot-swapable cable to connect the drive to the system). 2) Make sure 'Show hidden files and FOLDERS' is selected, and 'Hide extensions for known file types' is unchecked by clicking 'My Computer\Tools\Folder Options\View' 3) Navigate to the following directory of the drive that you've just connected (in this case we'll say it's drive (E:) ) 'E:\WINDOWS\system32\config' 4) Right-click the desktop and select 'New' then 'Folder' and name it 'TMP' or something you'll remember and open the folder. 5) There will be 5 files without any extensions at all. Just what you see between the single quotes, 'Default', 'Software', 'System', 'SECURITY' and 'SAM'. Hold down the CTRL key and click each of these files then right-click one of them and drag them into the new folder that you just made on the desktop and choose 'move' 6) In 'My Computer', Open 'Local Disk (C:) and scroll down to 'System Volume Information', Right-Click and select 'Sharing and Security...', then click 'Security' click 'Add' and enter your user account name in the box and click 'Ok' 7) Check the box next to 'Full Control' and click 'Ok'. Open 'System Volume Information', and then '_restore{52D47666-AC67-41BB-8E40-C4A9FA6443A1}' (the letter-number combination differs from one drive to the next). <--(That was supposed to be an '8') Now you get to choose your restore point (as you pointed out, they're numbered...They're also dated if you enable 'details' from the 'view' drop-down box on the folder menu over the address box). 9) Once you've picked your restore point, there's another folder in here called, 'Snapshot'. Open the 'Snapshot' folder. 10) Inside the 'Snapshot' folder there are 5 files that begin with, '_REGISTRY_MACHINE_', and end with the same 5 file names as in step 5 (the only difference being that there's a '.' before 'DEFAULT') , so hold down the CTRL key, just as in step 5, and click '_REGISTRY_MACHINE_.DEFAULT', '_REGISTRY_MACHINE_SOFTWARE', '_REGISTRY_MACHINE_SECURITY', '_REGISTRY_MACHINE_SYSTEM' and '_REGISTRY_MACHINE_SAM'. Right-click one of them and select, 'Copy'. 11) Navigate to 'E:\WINDOWS\system32\config' and right-click and paste the files. This is the same directory that you moved the files from step 5 out of. 12) Right-click each of the FIVE files and select, 'rename'. Remove everything from the name except for the very last part of the name before the last underscore ('_'), so '_REGISTRY_MACHINE_.DEFAULT' becomes, 'DEFAULT' , '_REGISTRY_MACHINE_SOFTWARE' becomes, 'SOFTWARE' and so on for the other 3. And that's it. You've just manually restored your computer. This can be useful when some really nasty virus disables your 'System Restore' functionality, and you can't get to the usual way of doing it from the 'Start\Programs\Accessories\System tools\System Restore' Sure hope this is useful to someone. Oh, I almost forgot, A good friend figured out my original dilema. All you need to do is enter the following...'CD Sy*' will put you into the 'System Volume Information' directory, and then, 'CD _*' will put you into the '_restore{52D47666-AC67-41BB-8E40-C4A9FA6443A1}' directory.Hi All, This is a CORRECTION update to my last post. In step 6, the 'Local Disk (C:)' should have been, 'Local Disk (E:). I'm sorry for any confusion, Michael |
|
| 1983. |
Solve : change text in XML files? |
|
Answer» that little batch snippet i wrote is all you need to change all xml files under the directory passed using sed. what more is it you require? in fact , i added the for loop only for doing recursive searching, otherwise if your xml files are all in one directory, then this is all you need. Actually, from the looks of that code, it will take all the .xml files from a directory and perform the word switch for each. (But I don't have sed, so ghostdog will need to confirm my thoughts)see reply 15 Quote from: ghostdog74 on March 24, 2010, 06:38:52 AM see reply 15Sorry, you must have GOTTEN in right before me, lol... Quote from: ghostdog74 on March 24, 2010, 06:36:22 AM Code: [Select]sed -i.bak "s/old/new/g" *.xml The above sed does not work. The original xml file remains the same Example: C:\batch>type ghost24.bat Code: [Select]echo off Rem The sed change is displayed to the screen only rem The original xml remains unchanged echo type envmig.xml type envmig.xml sed "s/newfile.xml/new/g" envmig.xml echo type envmig.xml type envmig.xml Output: C:\batch>ghost24.bat type envmig.xml newfile.xml new type envmig.xml newfile.xml C:\batch>it remains unchanged because you did not redirect to a new file or use -i. sed by default doesn't change files. please look at my code again and compare it to yours. Its totally different. Why do you produce different code and say it does not work. ? Quote from: ghostdog74 on March 24, 2010, 09:56:40 AM it remains unchanged because you did not redirect to a new file or use -i. Ghost, Thanks for your help. I must have a different version of sed than you do. I cannot get my sed to work with your code. C:\batch>sed -i.bak "s/HKCU/new/g" envmig.xml Unknown OPTION "-i.bak" Usage: sed [-nE] [script] [-e script] [-f scriptfile] [file ...] C:\batch> ______________________________ C:\batch>type envmig.xml | more http://www.microsoft.com/migration/1.0/migxmlext/oobeupgrade"> oobeUpgrade %WINDIR%\oobeUpgrade MigXmlHelper.IsOSLaterThan("NT","6.0.0.0") MigXmlHelper.DoesObjectExist("REGISTRY", "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Music]") MigXmlHelper.IsSameStringContent... . . .why are you using crippled sed?? see reply 13 on where to download GNU sed. All my *nix tools are from GNU, not mks. and its free.. Quote from: ghostdog74 on March 24, 2010, 11:44:09 AM why are you using crippled sed?? see reply 13 on where to download GNU sed. All my *nix tools are from GNU, not mks. and its free.. Please show me the output for your sed. sed -i.bak "s/old/new/g" *.xml it doesn't take 5 minutes to download and try it out yourself. Quote from: ghostdog74 on March 24, 2010, 11:54:30 AM It doesn't take 5 minutes to download and try it out yourself. The gnu sed did work: sed -i.bak "s/HKCU/new/g" envmig.xml The redirection is implicit with -i.bak. envmig.xml.bak is created in the same directory. Then envmig.xml.bak is copied over envmig.xml. The changes to envmig.xml appear to occur in place. One line of sed code to replace the long batch file above. Command line arguments could be used for "old" and "new". Then the sed code sed -i.bak "s/old/new/g" would not need to be changed each time. Output: C:\batch>c:\bin\sed -i.bak "s/HKCU/new/g" envmig.xml C:\batch>type envmig.xml | more http://www.microsoft.com/migration/1.0/migxmlext/oobeupgrade"> oobeUpgrade %WINDIR%\oobeUpgrade MigXmlHelper.IsOSLaterThan("NT","6.0.0.0") MigXmlHelper.DoesObjectExist("Registry", "new\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My M usic]") Input: C:\batch>type envmig.xml | more http://www.microsoft.com/migration/1.0/migxmlext/oobeupgrade"> oobeUpgrade %WINDIR%\oobeUpgrade MigXmlHelper.IsOSLaterThan("NT","6.0.0.0") MigXmlHelper.DoesObjectExist("Registry", "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders [My Music]") MigXmlHelper.IsSameStringContent Quote from: GREG on March 24, 2010, 02:47:23 PM One line of sed code to replace the long batch file above.EXACTLY! Ghost said that a the top of the page in reply #15! Quote from: Helpmeh on March 24, 2010, 06:37:01 AM Actually, from the looks of that code, it will take all the .xml files from a directory and perform the word switch for each. (But I don't have sed, so ghostdog will need to confirm my thoughts) If Helpmeh does not have have sed then Helpmeh was unable to test the code. Helpmeh doesn't test the code or show output. Helpmeh wrote: (post #26 ) "EXACTLY! Ghost said that a the top of the page in reply #15!" |
|
| 1984. |
Solve : Dos Dir CMD to send info to a txt file?? |
|
Answer» Running Win XP Pro. |
|
| 1985. |
Solve : Batch Delete Files And Folders? |
|
Answer» I Seriously Need Help My Friends ! I Am Making Dos Setup For Some Portable Programs 1] It Is In .\Other Folder But Should Be Exectued From "temp" Folder (Basically This Work Could Be Done By WRAR , But Still If Another Steps) C:\batch>type joke27.bat Code: [Select]echo off cd \ md other cd other echo HELLO joker > joker27.txt md other2 cd other2 echo hello joker > joker28.txt cd \ cd other Type joker27.txt cd other2 type joker28.txt cd \ cd other cd other2 del /Q *.* cd .. rd other2 cd \ del /Q c:\other\*.* rd other rem MV c:\batch\joke27.bat c:\temp\ rem del c:\temp\joke27.bat Output: C:\batch>joke27.bat hello joker hello joker C:\>THANKS Dude !!!!! |
|
| 1986. |
Solve : Found cmos battery? |
|
Answer» I finally found the BATTERY for my computer ! It's soldered in. Does anyone know where I can find one these? Can it be replaced |
|
| 1987. |
Solve : Execute files using a batch? |
|
Answer» I am trying to make a BATCH file so that i can easily start one of the many programs i have, without spamming my desktop with icons. I can get the menu and everything down, but i am having problems with executing them. I have tried USING CALL and just entering the file name after setting the directory. The programs start, but the batch file does not continue until after I close the program. It just sits there waiting. How would i set it to start it, and continue without waiting?I have not tried to code the process but here are a few ideas. 1) Have the menu ( main batch ) call the sub batch^ ^ Could Be The Best option For EXAMPLE Code: [Select]echo off color 0c echo. echo Pls Wait Executing Applications.... echo. FIRSTFILE.exe cls echo. echo Pls Wait Executing 2nd Application echo. SECONDFILE.exe cls rem And So On The File Names echo. echo Done! echo. pauseI've already tried something like that, but the secondary batch just pauses and sits there ALSO. I have to close the program before the secondary batch continues, and the secondary has to finish before the first continues.Try using the start cmd (type start /? at the cmd prompt for more info) Code: [Select]. . echo. echo Pls Wait Executing Applications.... echo. start "" FIRSTFILE.exe cls echo. echo Pls Wait Executing 2nd Application echo. start "" SECONDFILE.exe . . THANK you very much, that last one worked |
|
| 1988. |
Solve : recursive search for the lowest level folder? |
|
Answer» Hello, I have to find the lowest level folder in a folder structure and insert a delete_me.txt in that level C:\BATCH>dir /s delete_me.txt Volume in drive C has no label. Volume Serial Number is F4A3-D6B3 Directory of C:\batch\lower\lower 03/29/2010 07:11 AM 10 delete_me.txt 1 File(s) 10 bytes Total FILES Listed: 1 File(s) 10 bytes 0 Dir(s) 296,553,267,200 bytes free C:\batch>cd lower C:\batch\lower>tree /f Folder PATH listing Volume serial number is F4A3-D6B3 C:. └───lower delete_me.txt C:\batch\lower>cd lower C:\batch\lower\lower>dir Volume in drive C has no label. Volume Serial Number is F4A3-D6B3 Directory of C:\batch\lower\lower 03/29/2010 07:11 AM . 03/29/2010 07:11 AM .. 03/29/2010 07:11 AM 10 delete_me.txt 1 File(s) 10 bytes 2 Dir(s) 296,553,267,200 bytes free C:\batch\lower\lower>C:\01Project C:\02Development C:\02Development\01 Documentation I have to introduce a delete_me.txt file in 01Project and in 01Documentation Quote from: mibushk on March 29, 2010, 06:59:42 AM C:\01Project cd \ md 01Project copy delete_me.txt C:\01Project\ md 02Development cd 02Development md 01 Documentation cd \ copy delete_me.txt "C:\02Development\01 Documentation\" Quote from: greg on March 29, 2010, 11:49:23 AM whatever |
|
| 1989. |
Solve : Java for DOS? |
|
Answer» Bah BC, I've programmed in java for 3 years and you still know more of java than me. =P MEH! Bah BC, I've programmed in java for 3 years and you still know more of java than me. =P MEH! Quote java was first designed for to work on microcontrollers of microwave's/washing machines/etc..Actually, by the time it had the name java they were aware that it was going to be deployed as a more general purpose language that ran on a VM; when they actually wanted to run it in coffee machines and other stuff as an "appliance language" or something it was still called "oak". Well, the only downloads you can find from sun will be for the win32 version of the VM; win32 requires... well, win32. (windows 95 and higher) Of course later versions of the windows VM are SPECIFICALLY written to use NT specific stuff so they don't work on win9x, either. The "best" windows 3.1 VM available is an ancient IBM release. It's the best available but it is still awful. Since it wasn't defined that you could run a "jar" archive directly until fairly recently you'd need to extract all the class files from it too... which would introduce loads more problems due to 8.3 filenames... and then you have to edit some weird file that tells the java system which 8.3 files map to what long file names. it's horrible. A DOS implementation of the VM is nearly impossible- best case scenario would SIMPLY be totally awful. the VM itself would need to emulate threads (it did in the win31 version, but it usually crashed)... messy, messy business. For windows 95, I'm not sure of the version that would work but you're probably looking at JDK 1.0 or 1.1, if you are really really lucky 1.5, or 2.0. but I doubt it. The best VM you can get for windows 95 is probably the Microsoft JVM, problem being that you can't get that anywhere now. If you have some old software discs, sometimes it came included with it. I know Visual Studio 6 has the MSJVM on it's CD; It's probably the same for any number of other applications, most notably Internet Explorer. Even so, that's just the VM... getting the SDK itself is another gambit altogether. I did a google and I found this: http://java.sun.com/j2se/1.3/install-windows.html Quote The Java 2 SDK is intended for use on Microsoft Windows 95, 98 (1st or 2nd edition), NT 4.0 with Service Pack 5, ME, 2000 Professional, 2000 Server, 2000 Advanced Server, or XP operating systems running on Intel hardware. is says it works on windows 95 [/quote] |
|
| 1990. |
Solve : Problem With VBS script? |
|
Answer» i made a script like |
|
| 1991. |
Solve : delete program? |
|
Answer» I'm using this program to delete stuff but it doesn't delete folders how can i make it delete folders
Additionally, if they want to permanently delete them, you can hold shift when you drop it on the recycle bin as well. |
|
| 1992. |
Solve : Batch Process, Folders, ICONs? |
|
Answer» I am using a batch process to push a folder to user desktop. Also have an ICON that I would LIKE to post on that folder instead of the manila folder look. Is there a series of DOS code steps that I can add to my BAT file that would set the preference of choosing a different ICON - the ICON that I've created? Quote from: Tulsastrategic on March 29, 2010, 05:10:13 PM ICON that I would like to post on that folder instead of the manila folder look. http://malektips.com/xpwex0001.html Tired of most folders looking like the same drab YELLOW open file? You can change a folder's icon in Windows XP to better signify its contents. To change a folder's icon: 1. Right-click on a folder and choose "Properties". 2. When the "Properties" multi-tabbed dialog box appears, select "Customize". 3. Click the "Change Icon" button. 4. Choose an icon you wish to use and click "OK", or click "Browse" to browse your system for other icons. Look for .ICO and .EXE files on your system for more icons. You may even want to download some freeware icons over the Internet. 5. Press "OK" to close the dialog box. Note that you may need to close and reopen the folder for the icon change to take effect. _____________________________ Drag and Drop 1) Open less than FULL screen the folder that contains the folder to move to the desktop. 2) Point the the icon and hold the left button down and drag to the desktop and release. Quote from: Tulsastrategic on March 29, 2010, 05:10:13 PM I am using a batch process to push a folder to user desktop. Also have an ICON that I would like to post on that folder instead of the manila folder look. Is there a series of DOS code steps that I can add to my BAT file that would set the preference of choosing a different ICON - the ICON that I've created? yep, you can create a desktop.ini file from WITHIN your batch file. if you copy an icon into the folder you can create a desktop.ini like this: Code: [Select][.ShellClassInfo] IconFile=icon.ico IconIndex=0 Thank you for the quick response. I had this code just after the MD command on separate lines. It didn't post the ICON, though. Does the ICON file need to be in the temp folder where the files land originally, or does the ICON file need to be in the final folder on the Desktop? Quote from: Tulsastrategic on March 30, 2010, 12:09:20 PM Thank you for the quick response. I had this code just after the MD command on separate lines. It didn't post the ICON, though. Does the ICON file need to be in the temp folder where the files land originally, or does the ICON file need to be in the final folder on the Desktop?the icon needs to be in the folder you are giving the icon to. Remember that stuff I posted was what you need in a desktop.ini file in that folder. it MIGHT also need to be hidden, I'm not sure.That's what I needed - thanks for the clarification. |
|
| 1993. |
Solve : count the number of files according to time modified? |
|
Answer» HELLO FRIENDS |
|
| 1994. |
Solve : Inserting a Blank Space Before Set /P Output? |
|
Answer» Quote from: BC_Programmer on March 30, 2010, 07:18:06 AM Sure Python/Perl have modules you can use for nearly everything; so does VBScript. It's called COM. and COM components are a lot easier to use from VBScript as compared to either Python or Perlthat is not true. If one really have extensive experience with Python/Perl, you will know there are too many things vbscript cannot compare. Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH). Or find me a good compression LIBRARY that supports widely used compression algorithm in vbscript. Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible. How about a sorting function in vbscript? till now, i don't see very good support on sorting. And how about emailing mechanism or the ability to do network/socket programming easily? How about a library for HTML/XML parsing or a library to grab a web page that also supports proxy authentication or SSL? Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well. How about portability of code? Python/Perl scripts WORKS in Mac,*nix. Is vbscript portable? I use vbscript as well and i have no problem coding with it when the situation needs, but if i have a choice on language to use on a production project, it will not be vbscript Quote from: ghostdog74 on March 30, 2010, 08:12:54 AM Find me a FTP module in vbscript that does file transfer, or secure file transfer(SSH).http://www.chilkatsoft.com/FTP-ActiveX.asp Quote Or find me a good compression library that supports widely used compression algorithm in vbscript.Google gives me 126,000 hits for "ActiveX Compression Library" Quote Data structures in Perl/Python are much easier to use than those in vbscript, and more flexible.All accessible via COM... or just create them yourself in VBScript classes. Seriously, you write them once, and you can reuse them. there doesn't HAVE to be a bloody module for every single god damned thing you mgiht want to use. Quote How about a sorting function in vbscript? till now, i don't see very good support on sorting.Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts. Quote And how about emailing mechanism or the ability to do network/socket programming easily?CDO. WinSock Control/Library. Quote How about a library for HTML/XML parsingMSXML. Quote or a library to grab a web page that also supports proxy authentication or SSL?WinHTTP. Quote Python/Perl already has extensive support for such things. COM? you might be surprised that Perl/Python supports COM as well. Did you even read my post? Quote from: BC_Programming and COM components are a lot easier to use from VBScript as compared to either Python or Perl (which in themselves need a module for this purpose) Quote How about portability of code? Python/Perl scripts works in Mac,*nix. Is vbscript portable?Nope. Sometimes I forget how important that 0.5 percent (ok, that's an underrepresentation) of the market considers itself though. Quote from: BC_Programmer on March 30, 2010, 08:40:39 AM http://www.chilkatsoft.com/FTP-ActiveX.aspI was betting you are going to show me this. sad to say first version out of support and limited in functionality. 2nd version cost money. seriously ? Quote Google gives me 126,000 hits for "ActiveX Compression Library"out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community. Quote Again: a case of roll your own. Writing a sorting routine is easy. This hardly even counts.sorting stuff is so common in daily task, you don't rewrite it when you want to use it every time . A good sorting library is a certainly a plus point. Try writing one by hand, that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically. how much time would you need to do it with vbscript? A module for every thing i want to do is even BETTER. honestly speaking, don't you sometimes want that? Quote sorting stuff is so common in daily task, you don't rewrite it when you want to use it every time No. you write it ONCE. and then you can that every time. Quote A good sorting library is a certainly a plus point. Try writing one by hand, that sorts by a field, then another field, followed by another field, lastly, by another field but this time sort numerically. Ever worked with listviews? Ever needed to do that as well as Natural sort the filename column? Yeah. done that. Actually, I didn't write the code that does the sort algorithm, that is actually in comctl32. My Actual Sorting stuff can be used to sort objects, and since the Actual comparison routine can easily be overridden it's a simple matter to change the comparison to make it sort on different fields. This wouldn't extend directly to VBScript since none of the scripting languages supports early-binding to COM components that I know of nor implementing a COM interface. I think they support event sinking so I could just make it raise events or something. Either way, I never have to do anything with VBScript. I only have one Script file that I ever use, that re-links an executable to change the subsystem. That's it. I largely consider VBScript to be VB6 but to be frank VBScript blows in comparison. and I am reminded of that every time I use VBScript. WHY does it complain when I say Next ? I could swear that's part of the language, but noooo, it makes me say just "next"... Quote I was betting you are going to show me this. That was just from a quick google. There are FTP controls built into windows but I'm not sure if those can be used without a IOLEInPlaceSite implementor. (that is... a window) I know the "Script control" can be used just as an Object. Quote out of the 126000 hits, which one is free and you have used it to support zip, gzip and is highly recommended to be used in vbscript ? with Perl/Python, compression libraries comes with the distribution and most of the time, its the recommended one to use and is supported by the community. Personally I'd just Use BCFile for that. Of course I'd need to get BCFile to work in VBScript, a mystery I have yet to bother solving since I never use VBScript, or any other scripting language often enough. Actually, I think I've lost track of the very point of a scripting language, which is, in general, to provide these types of things. unzipping and zipping can be done with the built in windows Zipping/unzipping but the mechanism for doing so isn't immediately obvious. It can be used indirectly by simply copying a file out of a zipped file namespace, but again- not completely obvious. Anyway, I think this is what confused me: Quote but if i have a choice on language to use on a production project, it will not be vbscript a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other TOP contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more. Language wars, I love them !! Seriously, if I wanted to ftp from vbscript I would (and have) call the ftp.exe on the command line Going back to the OP's question, are there 'invisible' characters that can be used as a space ? I remember the old DOS trick of naming a file -255 to hide it no longer works under 32 bit windows Just a THOUGHT - does echo Hallo give the required indentation ? If so and you can live with a non-indented response, follow the prompt with: Set /p var= Which will not add any prompt textseems like W7 set /p strips leading spaces from the prompt string. Quote from: Salmon Trout on March 30, 2010, 02:17:21 PM seems like W7 set /p strips leading spaces from the prompt string.Yes, and so does Vista. The command interpreter is "CMD.EXE" and it seems to be not the same one used in Windows XP that has the same name. So the challenge here is to either: 1. Modify the way CMD does the SET command to allow e space char. OR 2. A clean utility that will show a custom prompt to user and take input and store in something that can be used later. Hmmm, "assembly language for windows" gives almost 2 million hits in Google. Maybe I should write a small machine code thing. Quote from: BC_Programmer on March 30, 2010, 09:46:49 AM No. you write it ONCE. and then you can <re-use> that every time.that's right.! write it once and reuse. that's the beauty of modules/functions. I don't see a vbscript sorting function/library that is able to provide different sorting criteria, like the one i mention, or sorting by keys of a dictionary, or sorting an array according to the keys of another. or sorting by the Nth character position. If i want to do any of these sorting tasks, i just need to plug in my parameters and the sorting function will do the rest. Quote a scripting language shouldn't be used in a "production" project. a scripting language should be used for scripting. python can be used for applications programming but that is- get this, outside the domain of VBScript (see the name? VBScript?) as far as Applications languages go python is an excellent choice but it's no better or no worse a choice then the other top contenders such as C#, VB.NET, F#, etc. Especially since the .NET framework is at least as extensive in function as perl/python modules; it includes classes for everything you mentioned previously and more.that's not correct. PHP is a scripting language and there so many production web sites that use PHP. Similarly for Perl/Python. Why do you think sysadmins use them to do their admin task? Scripting languages can definitely by used anywhere. And Perl/Python are also considered scripting languages (general purpose). no different from vbscript. they both need interpreter to run their script. Quote from: gpl on March 30, 2010, 12:42:43 PM Just a thought - does If I understand what you are saying correctly, the problem here is that set /p always(I think) uses its own line, even if you do something like: Code: [Select]echo Faking the promptString here & set /p var=The user's input would start on a new line after the fake promptString, which is messy, and is still yet a displayed line that is not getting indented. I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool. I think I need to read the C book I bought 2 years ago and just be done with it. ...then again maybe not Thanks to everyone again for all the help, this is a great community to be a part of, I wish I had more to give back. Quote I think I'll try the suggestion Salmon Trout gave, which was the third-party Editvar tool. You have made a wise choice. Not the choice of everybody, Not the choice of the most clever. But the choice that will work for you. Quote from: Geek-9pm on March 31, 2010, 01:13:30 PM Not the choice of the most clever. Are you saying I'm not clever? Quote from: Salmon Trout on March 31, 2010, 01:16:50 PM Are you saying I'm not clever?Ah...er.. uh maybe I shod rephrase that. Quote from: Geek-9pm on March 31, 2010, 01:28:51 PM Ah...er.. uh maybe I shod rephrase that. ah ha! so your saying his idea is shoddy! Quote from: BC_Programmer on March 31, 2010, 01:30:10 PM ah ha! so your saying his idea is shoddy! I have been to "The shoddy capital of West Yorkshire", the town of Dewsbury. In the 19th century that region of England had a thriving cotton spinning industry and somebody invented a machine for grinding rags or pieces of waste or used cotton cloth, which was called "shoddy", so that the fibres ("fibers" in the US) could be spun into new cloth. The town became the hub of this industry and even in the 1980s the place was full of cotton recycling plants and in the streets you could see little bits of fluffy stuff lying on the ground. It made some people rich and gave jobs to a lot more. |
|
| 1995. |
Solve : Detect RAM with Batch file? |
|
Answer» Hello everyone, Im glad that you can say me sh*t in spanish too... just kidding... LOL joder means f*ck doesn't it? I know how to say me cago en d....... Like the priest in "La Caja" (a film I like) |
|
| 1996. |
Solve : Help Making a Batch file? |
|
Answer» Hey all , |
|
| 1997. |
Solve : find an ip address? |
|
Answer» What is the command used to display the list of IP address of the computers in LAN or is this even possible? |
|
| 1998. |
Solve : find and to show some word.? |
|
Answer» in hardware.txt In batch file. Can you do ?sure, open your editor, type the command in, Code: [Select]gawk -F":" "{print $1}" file then save as mybatch.bat, that's it. |
|
| 1999. |
Solve : hostname in batch file? |
|
Answer» how can i get the HOSTNAME from a workstation and make a folder NAMED the same as the workstation? i have tried "setlocal, set hostname=%hostname%, endlocal".
C:\>type thirty7.bat Code: [Select]echo off hostname > host.txt type host.txt pause md Okie cd Okie echo hello okie > host.txt type host.txt Output: C:\>thirty7.bat Okie Press any key to continue . . . hello okie C:\Okie>another greg Quote from: ghostdog74 on April 04, 2010, 06:10:09 PM another gregI already sent a PM to Nathan... Quote from: ghostdog74 on March 31, 2010, 08:07:48 AM on your command prompt, type Code: [Select]env. You can see computer name there. I use XP pro SP3 and there is no env command. Quote from: BobJordan on April 04, 2010, 08:55:11 PM I use XP pro SP3 and there is no env command.Here. |
|
| 2000. |
Solve : generate text files with replaceable parameters inside? |
|
Answer» Here is a text (inf) file I am using INSIDE a BATCH file (call it warp.inf) with 339 and ne as replaceable parameters somehow
I will leave problem (1) for the other guy, but I can see straight away why only the first line of run_makethisinf.bat gets executed. The reason is this: If you, in a batch file, want to run another batch file, there are two ways of doing it. 1. Use its name alone. In this case control is handed over to the second batch file permanently, and the first batch file terminates. In other words you never go back. 2. Precede its name with the CALL keyword. In this case the first batch hands over control to the second batch file temporarily, and waits for it to finish. When that happens, control is passed back to the calling (first) batch file and execution continues on the next line. So your run_makethisinf.bat should look like this Code: [Select]call makethisinf m_930_nw call makethisinf m_930_ne call makethisinf m_930_sw calll makethisinf m_930_se pause Thanks for the help. If there is no way to get those two lines to resolve themselves, my fallback is this (for northeast,northwest,southeast, and southwest. It requires that I edit each xxx once in notepad once it is done. I'm getting there, but .......... echo call makethisinf4 m_930_nw m_930_ne m_930_se m_930_sw call makethisinf4 m_931_nw m_931_ne m_931_se m_931_sw pause echo [Source] >> %1%.inf echo Type = GeoTiff >> %1%.inf echo Layer = Imagery >> %1%.inf echo SourceDir = "C:\PHOTOREAL" >> %1%.inf echo Variation = Day >> %1%.inf echo SourceFile = "m_xxx_nw.tif" >> %1%.inf echo NullValue = 0,0,0 >> %1%.inf echo [Destination] >> %1%.inf echo DestDir = "C:\PHOTOREAL" >> %1%.inf echo DestBaseFileName = "m_xxx_nw" >> %1%.inf echo UseSourceDimensions = 1 >> %1%.inf echo CompressionQuality = 100 >> %1%.inf echo [Source] >> %2%.inf echo Type = GeoTiff >> %2%.inf echo Layer = Imagery >> %2%.inf echo SourceDir = "C:\PHOTOREAL" >> %2%.inf echo Variation = Day >> %2%.inf echo SourceFile = "m_xxx_ne.tif" >> %2%.inf echo NullValue = 0,0,0 >> %2%.inf echo [Destination] >> %2%.inf echo DestDir = "C:\PHOTOREAL" >> %2%.inf echo DestBaseFileName = "m_xxx_ne" >> %2%.inf echo UseSourceDimensions = 1 >> %2%.inf echo CompressionQuality = 100 >> %2%.inf echo [Source] >> %3%.inf echo Type = GeoTiff >> %3%.inf echo Layer = Imagery >> %3%.inf echo SourceDir = "C:\PHOTOREAL" >> %3%.inf echo Variation = Day >> %3%.inf echo SourceFile = "m_xxx_sw.tif" >> %3%.inf echo NullValue = 0,0,0 >> %3%.inf echo [Destination] >> %3%.inf echo DestDir = "C:\PHOTOREAL" >> %3%.inf echo DestBaseFileName = "m_xxx_sw" >> %3%.inf echo UseSourceDimensions = 1 >> %3%.inf echo CompressionQuality = 100 >> %3%.inf echo [Source] >> %4%.inf echo Type = GeoTiff >> %4%.inf echo Layer = Imagery >> %4%.inf echo SourceDir = "C:\PHOTOREAL" >> %4%.inf echo Variation = Day >> %4%.inf echo SourceFile = "m_xxx_se.tif" >> %4%.inf echo NullValue = 0,0,0 >> %4%.inf echo [Destination] >> %4%.inf echo DestDir = "C:\PHOTOREAL" >> %4%.inf echo DestBaseFileName = "m_xxx_se" >> %4%.inf echo UseSourceDimensions = 1 >> %4%.inf echo CompressionQuality = 100 >> %4%.infIt seems to me that your problem because you need to know that (unlike ordinary batch variables) parameters passed to a batch file from the command line or from another batch only have ONE percent sign, placed before the figure. Not after as well. Like this... echo first parameter is %1 echo second parameter is %2 etc Also did you realise that >> appends data to an already existing file (if there is one)? It's working perfectly now.......your point did the trick.. in the example that mat123 posted I interpreted the second % sign erroneously...... This code works perfectly.... I will use Excel to produce the batch file with the numbers bumped thru the entire range in the upgraded run_makethisinf echo [Source] >> %1%.inf echo Type = GeoTiff >> %1%.inf echo Layer = Imagery >> %1%.inf echo SourceDir = "C:\PHOTOREAL" >> %1%.inf echo Variation = Day >> %1%.inf echo SourceFile = "%1.tif" >> %1%.inf echo NullValue = 0,0,0 >> %1%.inf echo [Destination] >> %1%.inf echo DestDir = "C:\PHOTOREAL" >> %1%.inf echo DestBaseFileName = "%1" >> %1%.inf echo UseSourceDimensions = 1 >> %1%.inf echo CompressionQuality = 100 >> %1%.inf echo [Source] >> %2%.inf echo Type = GeoTiff >> %2%.inf echo Layer = Imagery >> %2%.inf echo SourceDir = "C:\PHOTOREAL" >> %2%.inf echo Variation = Day >> %2%.inf ..................................etc ...................................etc I am grateful for the help......I do understand about appending to an existing file, which I suspect could be used to shorten the makethisinf.bat program if a large number of lines were simply characters lines with no replaceable parameters....like the first 5 lines here.. bf just because you don't understand how something works doesn't mean it's wrong. |
|