InterviewSolution
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.
| 1. |
Solve : secrect message batch? |
|
Answer» Once I realised what "var" was, I got thinking and I was able to make the program take one input and code and decode it. I also tried something that compacts the hole thing into one file. I copied the contents of a.txt into the batch file and told it to look at itself for the key. lol Helpmeh you are 1337 (READ. leet)Oh I know what 1337 is, but are you a h4x0r? but I'm not 1337 any more...baww! OP what message do you get when you try my code?This is like watching cave-men try to figure out a pair of pants.Helpmeh I think I may have PUT it in the rong place. If you could put a few lines of code with your change in it so that it is easy to find in my file and paste it in. I am using the file above so make shour that it works with it. My major problem now is that I tried to make the program loop so that you do not have to constantly open and close the batch file. What hapend is that the small pause echoing problem stated above becomes big when you go through a few codings and decodings there are many "pauses" and it is very hard to read around it and the previous text you entered also repeats. Here are the changes. The goto. Code: [Select]if not "%tmpa%" equ "" goto LOOPD echo DECODE: %deword% goto START pause a=87 It sends you here. Code: [Select]echo off :START setlocal enabledelayedexpansion set /p encode=WORD:It is very annoying so please any suggestions would be helpfull.I have finshed the program to a point were it is useable. I've fixed the major problems and added capital letters. The only odd thing is the number 0 that shows up but I chose that and it is easily CHANGEABLE to a nother number or even a letter if you so DESIRE. The first time you use it, it will make a file called "code.txt". That is were you can easily copy the coded mesage and past were ever you want. The first thing you will notice when you run the program is that it has a white background and black letters. I find that easier to read. The program is attached for download. Version 3.3 [attachment deleted by admin] |
|
| 2. |
Solve : Folder Transfer Batch File? |
|
Answer» Quote from: Law506 on August 01, 2008, 09:43:09 PM What command would I throw into the batch file to have it OUTPUT in the text file how many FOLDERS it moved? echo off cls echo -------------------------------------------------------------------------------------------------------- >>Transfer.txt date /t >>Transfer.txt time /t >>Transfer.txt echo This will transfer all folders in SCAN to the ALPHABETICAL SCANNED DOCUMENTS. echo To stop the process CLOSE this window. echo LIST of Files Moved. >>Transfer.txt pause setlocal enabledelayedexpansion set Source=C:\Scanned Documents\ set Target=C:\Alphabetical Scanned Documents\ set /a foldersmoved=0 for /f "tokens=*" %%a in ('dir "%Source%" /ad /b') do ( set Current=%%a xcopy "%Source%\%%a" "%Target%\!Current:~0,1!\%%a\" /S /D /Y /C >>Transfer.txt set /a foldersmoved=!foldersmoved!+1 ) echo End Of Copy, see Transfer.txt for list of moved files. echo End Of Copy. >>Transfer.txt echo Folders moved: %foldersmoved% >> Transfer.txt pauseAwesome, works like a charm just like I expected. Thanks Again. Quote from: Law506 on August 01, 2008, 09:43:09 PM hey, for /f "tokens=*" %%a in ('dir "%Source%" /ad /b') do ( set Current=%%a xcopy "%Source%\%%a" "%Target%\!Current:~0,1!\%%a\" /S /D /Y /C >>Transfer.txt If %ERRORLEVEL%==0 ( GOTO :EOF ) else ( Echo The following file completed with %errorlevel% >> errorlog.txt ) )what "following file"? Can't quite see how the filename gets echoed. Quote from: Dias de verano on August 03, 2008, 09:00:02 AM what "following file"? Can't quite see how the filename gets echoed. Sorry should have read "following %%a"but the dir /ad in the loop makes %%a a folder, not a file. Quote from: Dias de verano on August 03, 2008, 10:49:18 AM but the dir /ad in the loop makes %%a a folder, not a file. Yes you are CORRECT again. My bad for not reading the script carefully, I guess I was focused on the script that I posted and remember that the search was for .pdf's. No I didn't make the assumption that the only files in any folder would be PDF's. But thanks again for pointing out my short sightedness DIAS. |
|
| 3. |
Solve : REG ADD Batch? |
|
Answer» Quote from: nothlit on October 27, 2010, 06:37:17 PM If left as CMD it goes to what I would consider the normal global run without the Wow6432Node. You do know there are two cmd.exe versions PRESENT in 64 BIT Windows? One 64 bit and one 32 bit? 64 bit... %windir%\system32\cmd.exe 32 bit... %windir%\SysWoW64\cmd.exe Below you can see I go from 64 to 32 bit cmd and back again. You can see how to check the version... Code: [Select]C:\Users\Mike>%windir%\system32\cmd.exe Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Mike>echo %programfiles% C:\Program Files C:\Users\Mike>%windir%\syswow64\cmd.exe Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Mike>echo %programfiles% C:\Program Files (x86) C:\Users\Mike>exit C:\Users\Mike>echo %programfiles% C:\Program Files http://www.tipandtrick.net/2008/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/ Thanks for that Salmon TROUT. Good information, I had run across the separation before that windows had the two environments but during this whole THING I really didn't think about it. Live and learn I suppose. |
|
| 4. |
Solve : How can we spot evil intent by a Poster?? |
Answer» QUOTE from: Carbon Dudeoxide on June 02, 2009, 06:30:30 PMdeleting files is not hacking....NOT EVEN CLOSE! BATCH can be used for pranking. Microsoft Visual Basic can be used for pranking. Batch can NOT be used for hacking. Quote from: Helpmeh on June 02, 2009, 06:33:12 PM Batch can NOT be used for hacking.this shows your ignorance. No i am not talking about pure batch. I am talking if you put tools like nc, nmap, nikto (etc and other command line hacking tools) in a batch file or simply just use them on the command line. Now, do you think your statement is correct? Quote from: gh0std0g74 on June 02, 2009, 07:17:39 PM this shows your ignorance. No i am not talking about pure batch. I am talking if you put tools like nc, nmap, nikto (etc and other command line hacking tools) in a batch file or simply just use them on the command line. Now, do you think your statement is correct?I meant pure batch...USING stuff like del isn't hacking... Quote from: Helpmeh on June 02, 2009, 07:27:28 PM using stuff like del isn't hacking...why is that so? Do you know that part of hacking is deleting one's traces? eg log files that might capture the actions of hackers or a temp hidden directory where hacker may have put his tools...so in that case, del is useful, right? Or do you even know what is hacking? Quote from: gh0std0g74 on June 02, 2009, 07:30:07 PM why is that so? Do you know that part of hacking is deleting one's traces? eg log files that might capture the actions of hackers or a temp hidden directory where hacker may have put his tools...so in that case, del is useful, right? Or do you even know what is hacking?I mean like someone calling the following hacking: echo off del "%userprofile%\*.*" Deleting one's traces wouldn't be directly considered hacking, but it can aid a hack...and batch can't make "VIRUSES!"... Quote from: Helpmeh on June 02, 2009, 07:32:14 PM and batch can't make "VIRUSES!"...are you really sure what you are talking now? with a combination of tools, you can indeed make batch virus. NB(from your previous post: VB can also be used to make macro viruses, don't you know that? ) Quote from: gh0std0g74 on June 02, 2009, 07:47:47 PM are you really sure what you are talking now? with a combination of tools, you can indeed make batch virus.Microsoft Visual Basic...I can make a form that freezes any Microsoft office program guarenteed after 2003.Carbon wrote: Quote You'd be very surprised how many 'pranksters' come here. And BTW, deleting files is not hacking.... If removing a directory and sub directories and files is not dangerous, why are Patio, BC and Carbon so concerned? Bashirpisj is pulling your leg, Playing with your unfounded paranoia of learning to be a Hacker from this Board of Nerds. Absurd. Nerds lost in their own little world. Quote from: billrich on June 02, 2009, 07:59:06 PM Carbon wrote:Did we say it wasn't dangerous? No. We said it wasn't hacking. Quote Unauthorized attempts to bypass the security mechanisms of an information system or network Using batch isn't really bypassing anything but the stupidity of the end user...anyone can view the source of a batch file, as long as they're smart enough to right click, and select edit. Quote from: Helpmeh on June 02, 2009, 08:02:06 PM Using batch isn't really bypassing anything but the stupidity of the end user...anyone can view the source of a batch file, as long as they're smart enough to right click, and select edit.no respectable hacker would even leave the batch file for you to right click on it. Quote from: gh0std0g74 on June 02, 2009, 08:06:30 PM no respectable hacker would even leave the batch file for you to right click on it.No hacker would do that. A skiddie on a mission on the other hand (basically everyone who helped FILL the network drive), would do that exact same thing.You can indeed make viruses from batch files. However, this isn't the point here. Nor is hacking. You're trailing off topic. Quote from: Helpmeh on June 02, 2009, 03:52:09 PM You just need to look at the post and ask yourself this question: "Why would they want to do/know that? What could happen if they find out?"Use your brain! If you're smart enough to get on the internet, you obviously have one.Since this has degenerated into slop it ends here. Topic Closed. |
|
| 5. |
Solve : Check to see if file is 15min or older than current time.? |
|
Answer» looks like we were thinking the same thing just going about it differently This is what I came up with (although your solution is more elegant) As for the zero I saw that if i did a min +1 it waited for the first 59sec to elapse before being seen thus giving me a false positive. What I meant was, if you use the -mmin +X -mmin -Y format you are specifying a time range: modified at least X minutes ago and not more than Y minutes ago. If you just use -mmin -Y you are going to catch any file modified from now, the PRESENT instant, back to Y minutes ago. In other WORDS if you just specify the "minus" ("not earlier than") time, the start of the looking-backwards time range is implicitly "right now". So that (surely) -mmin +0 -mmin -2 is equivalent to -mmin -2 i.e. -mmin +0 is superfluous? I have tested this and found that putting just -mmin -1 will find a file 2 seconds old. Here it finds a file which was modified 2.45 seconds before. You will see I have renamed the GNU find.exe because like many people I deplore the idea of having 2 different executables, one native, one third party, with the same (common) name. Code: [Select]C:\>echo %time% & gnu-find.exe T:\timelog -type f -mmin -1 | findstr "MyTimeLog" 9:17:52.43 T:\timelog/MyTimeLog-09-17-50-98.txtwell here is the final script that is running in production. It tested pretty well. At the MOMENT I'm the only one it pages so if it goofs I'll be the only one getting the pages Code: [Select]echo off ::CHECK scheduler status. :checktime Ufind.exe c:\timecheck -type f -mmin +0 -mmin -30 | findstr "servertest.csv" >nul && goto end echo %date% %time% "sending message" >> schedlog.txt mailsend1 -d yourdomain.com -smtp yourdomain.com -port 25 -starttls -v -f [email protected] +cc +bc -auth-login -user [email protected] -pass "yourpassword" -t [email protected] -sub "Check system scheduler" -M "Scheduler has stopped for more that 30min" echo "text sent to user" >> schedlog.txt ::wait 5 min and try again ping 127.0.0.1 -n 300 >NUL goto checktime :end ::Do not send txt exit I changed the unix find command to ufind and put it in the system32 directory along with mailsend1 (latest version of mailsend) I added the looping so that i would get pages every 5 min. In windows scheduler I put that if the program has been running longer than 25min to stop it. I run it through the scheduler every 1/2 hour. I hope this helps someone else stuck in the same bind. thanks again Salmon Trout! |
|
| 6. |
Solve : usb auto start script like in the pre 2009 days autorun.ini autoplay.exe win7? |
|
Answer» a rant you call it. more like i am upset becouse so many are against progress. many people were loving that they could plug in there device and instantly go about their business. we all just want to push a button and the computer start up and browser to open and go about our business. Wow... That is one *censored* of a script! (i.e. a silly one). The OP's request to "PM me" would get him banned from SEVERAL forums that I am a member of, such as Autoit, as would, also, his posting style. |
|
| 7. |
Solve : Batch file to copy files from server location to pc's on domain? |
|
Answer» i have to reply to a two-year-old thread again!! |
|
| 8. |
Solve : Batch Script: Find and replace strings in text file? |
| Answer» | |
| 9. |
Solve : Renaming from xml content? |
|
Answer» Quote from: foxidrive on May 18, 2014, 01:16:33 AM Non-Latin characters are difficult to deal with I THINK. Each region has their own special characters and the OP could have files from anywhere. That means each region has their own CODE PAGE to handle the special characters in that region. |
|
| 10. |
Solve : Create a directory with today's date and delete one with yesterday's? |
|
Answer» An infinitely simpler system would be to NOT delete a folder with a name matching Yesterdays date. |
|
| 11. |
Solve : What is the optimal high level language for batch files? |
|
Answer» Quote from: BC_Programmer on December 13, 2011, 03:20:14 PM If you are asking what other high-level language would be the easiest to port to, well... none of them. You would end up rewriting it from scratch anyway, which makes the question sort of moot.Not entirely true. Powershell will still recognize most batch commands. Also allows you to utilize VBScripts within the same "program." Might be the only other language available that would allow some porting options from batch. Still, the OP may be much better off utilizing an actual programming language to accomplish whatever tasks that are needing accomplishment. Or you could always reasearch and TRY writing your own program in machine language as well. Talk about efficiency. You take out the compiler aspect completely. Of course it will likely only work for your particular chipset, but it will work nonetheless. Quote from: Raven19528 on December 13, 2011, 04:05:04 PM Not entirely true. Powershell will still recognize most batch commands.It doesn't recognize any batch commands. It does have a few commands that happen to have the same name as existing batch commands. Dir acts completely differently and is just an alias for ls, much as it is on most modern distros. sort doesn't execute the sort.exe 'external' command, and instead invokes the built-in sort cmdlet, which has a different syntax and usage. Things like SETLOCAL, the addressing of variables using either percent signs or exclamation marks, and several other frequently used features are nonexistent or drastically changed in Powershell. set works differently. for is completely different altogether. there aren't goto's or labels, those would have to be replaced by functions. Commands like "Start", "fc", "if" and so forth are either noexistent (if), have completely different functions altogether (fc= File Compare in batch, Format_Custom cmdlet in Powershell), or have different parameters, limitations, and fiobles (start)). Any non-trivial Batch script will end up being pretty much rewritten to be "ported" to Powershell. Powershell is closer to Bash than it is to Batch. Quote Also allows you to utilize VBScripts within the same "program."No idea what this means. VBScript- and in fact the ActiveX Scripting Host- can be accessed from powershell, but I can't think of a way to integrate VBScripts into a Powershell script any better than the same type of echo method used in a batch for that purpose. The "integration" basically consists of still allowing you to execute CScript.exe from powershell. Quote Might be the only other language available that would allow some porting options from batch.It offers no more portability for batch code than Bash. Nobody opens up a Batch Script in gedit and screws around with it until it works. You rewrite it using the native functionality of Bash; same for Powershell. Quote Still, the OP may be much better off utilizing an actual programming language to accomplish whatever tasks that are needing accomplishment.Except Batch is "an actual programming language" as is Powershell. Thing is, it already sounds like they accomplished what they want in Batch, thus Salmon Trout's original question as to why they need to do anything further. Quote Or you could always reasearch and try writing your own program in machine language as well. Talk about efficiency. You take out the compiler aspect completely. Of course it will likely only work for your particular chipset, but it will work nonetheless.I know this was probably facetious, but the compiled result from most modern compilers will be many times faster and more optimized than Machine code, UNLESS that person has spent the last 40 years hand-tuning machine code. Same for Assembly, which would have been far saner to mention since there isn't a huge difference between Assembly and Machine code, that's why Assembly is assembled, it's basically a process of substitution of Assembly keywords with the appropriate machine instructions. Also, most of the "Batch compilers" I've seen tend to use a 32-bit executable to wrap the batch file which is no less machine-dependent than hand-tuned x86 Assembly. Well thank you for tearing apart my post. *goes into corner and cries ...comes back* Yes I was being facetious with that last comment. I mentioned it because I recall a homework assignment that had us do the machine code for an 8088 chipset that would assign two variables, add them together, and output it to the screen. It was ridiculous the amount of work that went into that. I was just happy that we were able to write it in hex rather than binary. As far as the actual programming language comment, that was written hastely and was inaccurate. I suppose the more correct term would be to say a programming language designed to output .exe files. Powershell is not one of them, I know. For Powershell, I haven't actually dabbled too much into it, and yes the stuff I did dabble in was a pretty trivial batch file. Powershell documentation had either the implicit or explicit connotation that many batch commands worked just as well in Powershell, or perhaps that the batch functionality was still supported through Powershell. It's been awhile, so I'm not certain. You have been very helpful in teaching me to stick with what I know and not to talk about the things I don't, as that's when the beatings start. You have effectively paddled me in front of the school assembly, so I will now lick my wounds and live to program another day. Quote from: Raven19528 on December 13, 2011, 06:02:01 PM Yes I was being facetious with that last comment. I mentioned it because I recall a homework assignment that had us do the machine code for an 8088 chipset that would assign two variables, add them together, and output it to the screen. It was ridiculous the amount of work that went into that. I was just happy that we were able to write it in hex rather than binary.My main point was that the people writing compilers are better than the vast majority of programmers at assembly... they know all sorts of tricks and implement them into the compiler. Quote I suppose the more correct term would be to say a programming language designed to output .exe files.Not really. There is no reason so far that they've given to use a language that makes executables. If their goal is "I just want executables" than, well, that's sort of a silly goal. Quote For Powershell, I haven't actually dabbled too much into it, and yes the stuff I did dabble in was a pretty trivial batch file. Powershell documentation had either the implicit or explicit connotation that many batch commands worked just as well in Powershell, or perhaps that the batch functionality was still supported through Powershell. It's been awhile, so I'm not certain.Everything I wrote I VERIFIED. you can run batch scripts from powershell but then cmd.exe is what interprets them, not Powershell. This can be useful so that if something comprises of several batch files, rewriting them in powershell could be done top down, and the powershell can call batch files, until those batch files are rewritten in powershell. Quote You have been very helpful in teaching me to stick with what I know and not to talk about the things I don't, as that's when the beatings start. You have effectively paddled me in front of the school assembly, so I will now lick my wounds and live to program another day.Sorry that's what happens when I drink too much coffee. I guess in further analysis that I dont really need to compile them as they run perfect in their native batch format (.cmd) The real need for comiling was for speed and not much else. i guess that i just will pick the language that seems to MEET the needs of the batch file (mainly set envir var's) and no {shudder} to writing in machine language, lol but will take a look at powershell too. many thanks for all the comments, great to learn at U of CH Quote from: BC_Programmer on December 13, 2011, 03:20:14 PM OK, but why do you need to compile them?Quote from: Salmon Trout on December 13, 2011, 03:41:03 PM skorpio07, we keep asking you:Quote from: Raven19528 on December 13, 2011, 04:05:04 PM Not entirely true. Powershell will still recognize most batch commands.Quote from: BC_Programmer on December 13, 2011, 06:27:32 PM This can be useful so that if something comprises of several batch files, rewriting them in powershell could be done top down, and the powershell can call batch files, until those batch files are rewritten in powershell.Quote from: skorpio07 on December 14, 2011, 07:57:11 AM The real need for comiling was for speed and not much else.So you were looking to slow down your batch file! J/K. LOL! I am sure you are aware now of why it wasn't speeding it up but actually slowing it down.i never got to the point of being able to test the speed issue, as the compiled program wasn't working as expected. working on a freebasic version, hopefully things work out. Quote from: Squashman on December 14, 2011, 08:28:05 AM I am sure you are aware now of why it wasn't speeding it up but actually slowing it down.so this is more or less solved... im going to use freebasic unless there are limitations when doing the port from batch. many thanks to all for your input and suggestions thanks |
|
| 12. |
Solve : Run wzzip from anywhere? |
|
Answer» Quote from: Geek-9pm on March 25, 2015, 02:41:26 PM Some common utilities are 'portable' in the sense taht they do not require installation in a specific directory and do not have DLL or other things needed. I think this can be expanded somewhat. A program being "installed" effectively ensures the software environment will allow the software to run. This could mean installing required runtimes, registering COM components or .NET assemblies into the GAC, or initializing settings files or registry keys, associating files, installing say a Windows explorer extension, etc. A "portable" program can be either a wrapped program- a wrapped program being launched via a wrapper program which effectively hooks all that programs attempts to read/write registry or other local system information and redirects it to perhaps a local INI file, or it can be a program that has the capability to operate in a portable fashion. What makes this topic interesting is that by, say, modifying the path, you are creating your own special "install environment". That is, you can now run, say, wzzip, directly from the command prompt. But any BATCH file you create will now require "installation" in the sense that you will have to make configuration changes to change the system path so the batch can access the program it requires. For example in this case if you want to in any way distribute- either amongst your own systems or even at large- a batch that uses winzip, realistically a user should only require that winzip be installed. They should not be required to MANUALLY "install" your batch file by MANIPULATING their system path variable so that winzip is accessible. It is actually quite straightforward to implement this behaviour. There are a few pieces of information that come into play: -using SET PATH or PATH commands in a batch script or command prompt will only change the PATH variable for the current session. This can be directly observed. If you create the following batch script: Code: [SELECT]Set PATH=C:\somefolder;%PATH% echo %PATH% You can double-click and run it repeatedly all you want, but each run will not add an additional "C:\somefolder" to the front of the path; it will always be the existing PATH environment variable as set in system properties, with C:\somefolder on the front. If you run it within the same session- repeatedly in a batch script or within a command prompt, then you will see that behaviour, and your path will get a duplicated folder path tacked onto the front with each run in that session. Rather than have the batch script require that the system path be changed, you can simply verify the program you want to run is available on the path- if not, you look for it and add the folder to the path, otherwise you just use it as you want. you can use WHERE to see if a program is available. if it returns a non-zero errorlevel than you can go look for it in well-known install folders, and then try again; if you cannot find it in any known install folders, you can then show an error message. For example (Paths may need to be changed, I seem to remember Winzip using a "Niko Mak computing" folder or something, but that may be ages back): Code: [Select]:retry where wzzip if errorlevel neq 0 goto setuppaths wzzip -params goto finished :setuppaths if exist C:\Program Files\WinZip\wzzip.exe set Path=C:\Program Files\WinZip;%Path%&goto retry if exist C:\Program Files (x86)\WinZip\wzzip.exe set Path=C:\Program Files (x86)\WinZip;%Path%&goto retry echo Winzip could not be found in it's default install location. :finished Doing it this way means: -Any user of the batch will only require the program you use to be installed in it's default install folder- they won't need to manipulate their path variable themselves or make other permanent changes to their system -If a program is available in multiple variants- perhaps a 64-bit and 32-bit version, you can prefer the 64-bit version on systems that have it without it being a requirement and without, again, any explicit action by the user before running your software. This implementation is itself, imperfect, of course- squashman's method- using start- is far more reliable and will allow the program to be launched regardless of where it is installed. The alternative- without start- of getting the same result would require using reg query to query the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\wzzip.exe (or winzip.exe, perhaps?) key, retrieving the the path value, parse that output to get the path itself and then add that path to the Path variable in the same manner as above. Quote from: strollin on March 26, 2015, 09:15:34 AM The problem with running a batch file to add it to the PATH is that each time you run the batch file it will add it again. Yes, this will HAPPEN if you run the batch file in the same cmd window again and again, but adding a setlocal as shown below will fix that. I think we agree that adding the folder permanently to the path is the better way to go. Code: [Select]echo off setlocal call "d:\bin.bat" wz -params |
|
| 13. |
Solve : Remove Double Quotes from Flat File? |
|
Answer» I concur with everyone's recommendation on using REPL, JREPL or FindRepl. A comma-separated values (CSV) (also sometimes called character-separated values, because the separator character does not have to be a comma) file stores tabular data (NUMBERS and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.Excel and similar spreadsheets have CSV conversions built-in. Use of a batch SCRIPT is needed in only a few cases. Just saying...The quote from Wikipedia says "Usually, all records have an identical sequence of fields". Shouldn't it be all the time? If any ONE of the records is not identical with all of the others (as far as the number of fields), it will be mis-aligned when opening up in Excel. Quote from: stew2652 on December 05, 2014, 08:45:26 AM The quote from Wikipedia says "Usually, all records have an identical sequence of fields". Shouldn't it be all the time? If any one of the records is not identical with all of the others (as far as the number of fields), it will be mis-aligned when opening up in Excel.I have seen some weird data in my time. There are files that have a record identifier at the beginning of the line to TELL you what the layout of the file is. This was pretty common back in the days of Cobol programming. Also, Excel can handle embedded line feeds if they are enclosed in quotes. |
|
| 14. |
Solve : Keyboard problem when entering password in Settings? |
|
Answer» Kyall, yes the keyboard is fine yet i cannot type anything into the password box, What's the deal, I was online along with you for at least 10 minutes there. You & I were looking at the same topic. It looks like you dropped off the grid about 3:35AM, 10 minutes after I put up the first half of this post. You should have refreshed the page and answered before you went offline. Quote from: Kyall on March 18, 2008, 03:01:59 AM needs an operating system. What is the deal with the OP system? Not running at all? Running bad? Running, but not windows(set up for some machine at work?) There simply has to be something there for you to know that: Quote from: Kyall on March 18, 2008, 03:01:59 AM yes the keyboard is fine yet i cannot type anything into the password box, Dias (and I) suspect that the keyboard is just fine, even in the bios. We suspect that the charactors being typed as the password are simply hidden from you as you type them, so the only KEY that you get a response out of is the enter key. Quote from: Dias de VERANO on March 17, 2008, 01:10:45 AM Do you mean when you type the letters of the password in CMOS you don't see them on the screen? Not stars either? But when you press Enter something happens? Like it says wrong password? Because that's normal. You stated that you have the password. Either the password given you is wrong, or you are mistyping it. (possibly because you can't see anything you get flustered. ) This may be a long shot, but do it anyway. Try the password again. But be extremely careful this time. Make sure that caps lock is off. Forget the fact that you can't see anything on the screen. Just type the charactors, slowly and carefully. If that doesn't work, try uppercase. Type slowly and carefully. And HOPE that you screwed up before, because you couldn't see what you were typing! If that doesn't work, your best bet is still killcmos, if you can find a way to run it. You must give us more information! (for the umpteenth time) 1. What Brand & Model is the laptop? 2. What is the appx. age of the laptop? 3. What is the deal with the OP system? 4. Windows? What version? 5. If Windows, do you have the Administrator's password? (maybe that's what you have, and not the bios password.) 6. Not Windows? Then What? 7. Can you run a program from the USB drive? 8. Does it have a floppy drive? (long shot)(if so try to boot from the floppy.) 9. Can you easily remove the hard drive? Please answer those 9 questions. There may be a very easy solution to your dilemma, but we are still only guessing without that information. We know you have a long day in school, but get back ASAP. 1. What Brand & Model is the laptop? Compact evo n1000v 2. What is the appx. age of the laptop? 3. What is the deal with the OP system? There is none, the laptop was formatted when it was given to me, even though the cd drive is broken. 4. Windows? What version? Was running XP Pro 5. If Windows, do you have the Administrator's password? (maybe that's what you have, and not the bios password.) Fair point, will contact the original owner of the laptop to see if its the Admin password or Bios 6. Not Windows? Then What? Nothing 7. Can you run a program from the USB drive? With OS, yes but without, not too sure, was going to Bios to boot from my flashdisk 8. Does it have a floppy drive? (long shot)(if so try to boot from the floppy.) Yes. i could try running a boot disk from it??? or not 9. Can you easily remove the hard drive? Yes Quote from: llmeyer1000 on March 18, 2008, 03:22:41 AM Dias (and I) suspect that the keyboard is just fine, even in the bios. We suspect that the charactors being typed as the password are simply hidden from you as you type them, so the only key that you get a response out of is the enter key. That did it, in cmos, thanks. sorry about the long replys, will tell you how i get on with the OS. Does that mean I was right? Sure looks like it to me! It's too bad that Kyall didn't explain things better in the first place. If he had done so, this thread would have been a WHOLE lot shorter. The whole thread is full of "reading between the lines" as to what was wrong. Even the solution was a result of that. Quote from: Dias de verano on March 16, 2008, 01:37:26 PM If we are "reading between the lines", it occurs to me that the OP may be expecting to see some characters (or maybe just asterisks) to appear when he types in a BIOS password, which is not always the case (You don't see anything on the Dell Optiplex I use at work) Good Job Dias! Next time Kyall, PLEASE take the time to explain things better! |
|
| 15. |
Solve : Split a Folder You Can ???? |
|
Answer» I'm not comfortable with EITHER HELPING with homework or BELITTLING the OP. I'm locking the thread. It's okay to not want to HELP, but if that's the case please just ignore (or report) the thread. THANK you. |
|
| 16. |
Solve : Is possible to use OSX, Linux and DOS together on same disk?? |
|
Answer» Found in a search: Commander (SC for short) was a BOOT manager/loader software application developed by VCOM. In the event that you have more than one OPERATING system installed on your system (i.e. personal computer, harddrive), System Commander makes it POSSIBLE to choose which one of these operating systems to boot. In this regard System Commander is comparable in overall functionality to software like NTLDR, LILO, GRUB, and Graphical Boot Manager, which also makes it possible to make such a choice at boot time.Does that help any? Ok, C++ sources there are, but how complete... neeeds check. Mhttps://www.partitionwizard.com/ Notice there is a free version. Thais software works with Windows 10 and many other systems. It is currently supported. I have only used the free version. Earlier I said that MS-DOS would destroy a large hard drive. That is not true. Just two days ago I did n experiment and found I could make a small FAT partition on my 500 GB HDD. But it has to be the very first primary and there to be a MBR on the disk. I boot MS-DOS 6.22 from a CD and can read both the CD and the C: drive. The CD pretends it is A: and MS-DOS seems to like that. I do not know if the partition manager can boot DOS from my hard drive. Id o not want to try.I think it is safer to just boot from the CD drive. As I recall, I put it on a mini CD and it worked because MS-DOS 6.22 does not take much space at all. Here is some more info about how this is done: Make a Boot-able MS-DOS 6.22 CD. Have fun! I found solution in other topic. Really I need not optical drive - like CD, DVD or other. I wnt to put to place of DVD drive else one harddisk - this solves all. Why: HDD1 1. OSX 2. Linux HDD2: 1. DOS 2. Windows Notebook has popup menu at boot time which can select between devices from boot... Really I'll have available 1x FDD 2x HDD and I think it is enough. MiroMIRKOSOFT, Good idea! Second drive is the DVD slot is great use of a laptop. Most of the time you never need the CD/DVD anyway. And if you do, a small portable drive on USB will work for the few times yu need it. To boot DOS, it must be first primary and use FAT but not FAT 32. Older DOS versions can not read FAT 32. And older DOS can not read beyond 8GB. That is why you want it to be first on the drive. Here it needs note - I'm using MS-DOS 7.10 with FAT32 support, older versions not. DOS 7.10 has many benefits, so I decided for. MiroGood choice. I named DOS 6.22 because it was the last stand alone DOS for Microsoft. And it was the last that ran or pre-386 computers. MS-DOS 7 and other versions REQUIRE a 32 bit CPU. Here is a site that gives user support for a modified version of MS-DOS 7.10 : http://dosworld.czweb.org/ Most of it is in English. That links provides really limited support, even two links are dead. Nice is that it has also Czech comments - I'm from Slovakia and know Czech language perfectly - we were Czechoslovakia... MiroGlad you found it. They are active and can offer support. Quote from: Geek-9pm on December 23, 2018, 05:48:17 PM I named DOS 6.22 because it was the last stand alone DOS for Microsoft. They stated they were using MS-DOS 7.10 immediately after your first post assuming DOS 6.22 asking for details. (reply #3 and #4). Quote And it was the last that ran or pre-386 computers. MS-DOS 7 and other versions require a 32 bit CPU. But... They have an Intel Mac, as evidenced by being able to run Linux Mint... Which also requires a 32-bit CPU.... In any case, I think both OS X and the Apple Firmware for the system are likely to be the thing throwing up most of the barriers to dual booting these systems. OSX, Bootcamp, and the Firmware as I UNDERSTAND it work together to allow booting other systems and if the system came with 10.4 than that was all in it's very early stages. |
|
| 17. |
Solve : Copy passowrd from text file to softwares? |
|
Answer» You WOULD think with something that advanced they wouldn't scrimp on important components..... Quote from: PATIO on October 09, 2016, 10:45:49 AM You would think with something that advanced they wouldn't scrimp on important components..... True dat. Gallifrey's version of CHEAP CHINESE components is probably the bugbear.Shame is the *censored* thing worked so well when i 1st got it... |
|
| 18. |
Solve : send email? |
|
Answer» If you just go to this WEB SITE you will find to version 1.15 witch i used and v 1.14 witch i do not KNOW what it is . Quote from: kv79 on MARCH 26, 2008, 01:22:37 AM If you just go to this web site you will find to version 1.15 witch i used and v 1.14 witch i do not know what it is what web site? ah sorry i in harry and i forget to put in web site http://www.muquit.com/muquit/software/mailsend/mailsend.htmlmailsend v1.14 (stable) is the latest stable version, v1.15b5 is the latest development version. |
|
| 19. |
Solve : How to search & replace a string in text file using a batch file? |
|
Answer» .... Does it mean: In string1, replace 'Mary' with 'Peter, Paul and Mary' and then PUT that in string 5, and then, in the resulting string 5, replace 'lamb' with 'lamb each'? Yes, that's exactly right. I could have used a single ampersand (command1 & command2 means 'do command 1 and then do command 2") but I am in the habit from Unix/Linux of using && - (command1 && command2 means 'do command1 and if it is successful do command2'). Works the same in Windows. They could just as easily have been on two lines like this, I guess I wanted to show what you can do on one line. set string5=%string1:Mary=Peter, Paul and Mary% set string5=%string5:lamb=lamb each% Quote from: Salmon Trout on November 18, 2019, 11:38:46 AM That VBScript has a feature I don't like. It overwrites the input file.Yes, that is by design. Quote As for Question 1, you can place a one-line batch script in your Startup folderWhat does ' //nologo' do? Quote If you code the actual paths to the input and output .txt files in the script, you can put the .vbs script itself in the Startup folder.I've tried that, it's unsure if that works. Quote This all looks a bit shaky though. If this is corporate data in a work setting, should you be doing this?No, it's just about a multiboot situation where Win10 was installed later, and thus, changes the "D-station" to a "C-station". Home stuff. Corporate, I wish. Not savvy enough for that. Thanks Salmon for your efforts. Do you know the Salmon song? "Salmon, Salmon, Salmon, You're so delicious I love you more than all the other fishes" Quote from: Salmon Trout on November 18, 2019, 11:38:46 AM If you code the actual paths to the input and output .txt files in the script, you can put the .vbs script itself in the Startup folder. I've tried it out now and it doesn't work. The Startup folder I use is this one: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\ And: D:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\ If I put the .vbs file into these folders, how do I ensure that they are actually executed on start up? Excuting them manually is no problem Quote from: H4ckRn00b on November 18, 2019, 11:51:18 AM What does ' //nologo' do? There are two 'script engines' in Windows, cscript.exe and wscript.exe. The cscript engine uses a console window to run a script. This means you can have lines of text output that you can read all at once. By default it shows a text 'logo' like this at the start of a script: C:\Users\Mike>cscript //logo test.vbs Microsoft (R) Windows Script Host Version 5.812 Copyright (C) Microsoft Corporation. All rights reserved. Hello World The //nologo switch gives just the script output C:\Users\Mike>cscript //nologo test.vbs Hello World This is test.vbs by the way wscript.echo "Hello World" The wscript.exe engine does not show a console window, and emits any output using message boxes (one for each wscript.echo statement, and you have to click OK with the mouse). You don't have to worry about a 'logo'. Quote I've tried that, it's unsure if that works. Can't you check? Quote Do you know the Salmon song? I like that song. However, I am named after a steam railway locomotive, London and North Eastern Railway No. 2506 Salmon Trout later renumbered to 60041 by British Railways in 1948. The loco was a member of a class all named after famous racehorses, so that's where it started. I think this is a candidate for 'Thread of the Month' ! Quote from: Geek-9pm on November 18, 2019, 03:53:59 PM I think this is a candidate for 'Thread of the Month' !to quote 10 year old Ben from "Outnumbered (2007)": ............."Sarcasm!" Quote from: Salmon Trout on November 18, 2019, 12:46:16 PM Can't you check?I did. Now, after several tries & REBOOTS, I GOT it right. Joy. Yah. I can give you the full script and .... context, but I'm not sure that'd be interesting to you. Quote (...)later renumbered to 60041 by British Railways in 1948. (...)Oooooooh..... hobby's showing! obsessive, a bit? Pure dedication, I'm sure.... <3 Quote (...)named after famous racehorses, (...)Locs with fish names, named after horses ...... Ya can't get more British than that! <3 |
|
| 20. |
Solve : measuring elapsed time of a task evoked in a dos batch file? |
|
Answer» Antonio POSTED a 2nd link that talks about the 24 hour problem. What would be the best solution if I START the process before midnight and when time changes from 23:xx:xx to 00:xx:00 to have a CORRECT time difference? Maybe adding 24 to hours? Or maybe adding dates to start time and end time?Quote from: dbenham Yes, assuming your process takes less than 24 hours to complete, then all you need to do is conditionally at 24 hours if elapsed is less than 0. |
|
| 21. |
Solve : Batch Script - Copy folder to remote computers? |
|
Answer» Quote from: Arotin on August 08, 2016, 10:43:16 AM The "!" in my password GETS disregarded because of the "enabledelayedExpansion" problem is i need that in there because the passwords have that... lol is there a way i can make it that it includes that in my password with delayed expansion enabled? It is POINTLESS for someone to answer your question when they could have to answer it again when you reply to say it doesn't work. Your knowledge doesn't cover the other issues that result when entering passwords or you'd KNOW how to answer this question yourself and wouldn't have asked it in the first place. People ignore a response because of their POOR understanding, and yet they believe they know a great deal. There is a term for this called the Dunning-Kruger effect and it is WIDESPREAD in technical forums these days. On second glance I see that you are just thankless, and made no response to an answer to your question earlier in this thread. Taking people for granted is another common blight on the internet. People do that without considering that they are interacting with a person, and they don't have enough sense of social morals to know that it is rude and self-centered behaviour. I was not the sole person that he ignored in this thread. Excuse my grumpy off-topic post for the 10,000th time I've seen this shabby treatment of people in scripting forums. |
|
| 22. |
Solve : How do I copy only changed files? |
|
Answer» Quote from: patio on August 04, 2016, 10:19:53 PM I despise made up acronyms... Me too! HGSF! I am guessing that copy works undex DOS but not Xcopy. Quote from: geoffl on August 04, 2016, 11:18:53 PM I am guessing that copy works undex DOS but not Xcopy. We are all guessing what you are doing what you are doing it with.I run old DOS software under windows using NT virtual dos machine. The batch FILE is run by my program which I guess means it runs under DOS. I have been using the copy command and it copies every file in the directory. When I changed copy to Xxopy I get the message - bad command of file. I am wondering Why xcopy works from the command prompt but not under virtual DOS Quote from: geoffl on August 05, 2016, 12:29:39 AM I run old DOS software under windows using NT virtual dos machine. The batch file is run by my program which I guess means it runs under DOS. I have been using the copy command and it copies every file in the directory. When I changed copy to Xxopy I get the message - bad command of file. I am wondering Why xcopy works from the command prompt but not under virtual DOS Virtual Dos means nothing to people reading here. We don't know what environment you are running under. We don't know what is in your batch file. You've been told why that error message occurs. You don't understand your problem and you don't understand how poor your level of detail and information is. When you run VER what version does it show, this way we can determine the exact OS version your running? such as I run VER and it shows: Microsoft Windows [Version 6.1.7601] If you run XCOPY/? does it show help information showing that XCOPY command exists? From the VER output we can determine what your running for OS environment: https://en.wikipedia.org/wiki/Ver_(command)You can try Rich Copy. I use it all the time. Works great.... https://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx?pr=blog It is a GUI version of robocopy written by a MS engineer. Quote I am running this under NTVDM Does that make a diffrernce?Yep, that changes things, Running the batch via command.com via the 16-bit DOS emulation provided via NTVDM means there will be no NT Command extensions available. It also means that all paths must be 8.3 paths, and there are a number of other limitations. If you enter the command: Code: [Select]echo %path%what is output? From the sounds of it there may be values listed that are an invalid drive under NTVDM. This message is output when command.com starts up. It looks like two entries were considered invalid drive specs. It's also possibly why you get "Bad Command or File Name" as it cannot find xcopy as a result. One possible workaround is to "escape" NTVDM. For example instead of having the MS-DOS program in question run your batch file- which will GO into command.com- you may be able to configure it to run your batch file through cmd (cmd /c batch.bat) if you can change the command. If not, you can have the batch file it runs instead launch your main batch file via cmd. That should hopefully prevent issues as the batch will be running under the same cmd.exe environment you've already confirmed it to function correctly with. For others- I am fairly certain their "batch file" consists of one xcopy command. It is running under the command.com interpreter of MS-DOS which is being launched, as described by the OP, by another MS-DOS program; This all takes place under the 16-bit emulation of NTVDM for MS-DOS applications, present in all 32-bit Windows versions. The MS-DOS command interpreter considers multiple entries in the PATH variable invalid, which is why those messages appear. when it then runs the batch itself, it can't find xcopy, possible because of those path errors - and thus emits "Bad Command or Filename". Quote from: BC_Programmer on August 05, 2016, 01:03:53 PM For others- I am fairly certain their "batch file" consists of one xcopy command. It is running under the command.com interpreter of MS-DOS which is being launched, as described by the OP, by another MS-DOS program; I shouldn't be quite so grumpy with the guy but the error message he posted isn't from an NT series Windows command prompt. command.com in modern Windows is a stub that calls CMD.exe and is only there for backward compatibility to fool older programs into thinking they are running under command.com If you open a prompt by typing command.com and then type a bogus command you'll get the modern error message and not "Bad command or filename". It seems to me that the fellow is using Dosbox or Virtualbox or some other emulator and in any case is not describing what he's doing at all. His question about an error is like going to your dentist and saying "I have a sore tooth, guess which one it is?" Quote from: geoffl on August 05, 2016, 12:29:39 AM When I changed copy to Xxopy I get the message - bad command of file. If you typed Xxopy in your batch script then there's your problem. True enough foxidrive. I can confirm that I was incorrect, even in the specific instance where Windows XP (as you noted, no details- including OS) is used and a MS-DOS program is run and then a DOS Shell opened from the DOS program, there is no "Bad command or filename" message (and certainly not "Bad command or file" in either case.) One possibility could be if it is a localized version and they are translating? It might use a message like that- but again, details that ought to have been mentioned. Thank you for your help and the considerable time you have spent. You must realize that the reason people come here is because they don't have the knowledge that you people have therefore some of the questions and answers can be a little confusing. I am a little concerned with Patio. My best guess is that he is an agro 12 year old going through puberty and has not learnt any social graces yet. Maybe some of you more intelligent guys could take him under your wing and teach him that abusive comments (most of what I see from him) drives people away from this site which, to me, has been a WONDERFUL source of information. Thank you again. GeofflWell my sincere apologies for pointing out a non-existing acronym that took 14 posts to be explained... Hope you feel better. I think you might be a few bricks SHORT of a chimney!If you put half the effort into providing real details that you did into composing a misdirected personal attack, this THREAD could actually make some forward progress. Quote from: geoffl on August 06, 2016, 04:50:05 PM has not learnt any social graces yet. geoffl, you still fail to provide details about the subject at hand and yet you write things like that above. Look in the mirror, my friend. |
|
| 23. |
Solve : CNC machines running on ms dos? |
|
Answer» Conner CP30104H |
|
| 24. |
Solve : Find and Replace text in all text files in a specific folder - NT4 OS? |
|
Answer» Trying to come up with a batch that will work with NT4 OS and find and replace specific lines in text files. There are about 60 of these text files that hold operational parameters in them. Up to this point on a weekly basis when they are updated on sundays at 7am, I have been just going in with notepad and changing the specific lines from N to Y to enable features and then ALT+F+S and ALT+F+X which i can get through 60 files pretty quickly manually changing specific lines to Y from N. if "%%b"=="$LASTSORT N" echo $LASTSORT Y but cool that batch doesnt need an escape character for the $ outside of a string " " area as I highlighted that your echo-ing out. Learned something new. Also reading the batch you provided it looks like its looking only in *.txt text files, so I would need to change the file extension to the extension of the target which would be one FOR loop for the *.xts and the another FOR loop for the *.mtx file extension to test when all *.xts files have been tested for the string match and replace if found. As I altered what you gave me below, or should it be best rewritten with an OR statement in a single FOR loop to test both for the string match in both *.xts or *.mtx files or even just change to a total wild card of a single FOR loop testing all files with *.*? or would a *.* cause a CRC Error due to it grabbing at the tempnewfile.tmp file which is also in the target directory of execution and has bitten me before with xcopy instructions with wild cards and writing back to source drive. Code: [Select]echo off cd "c:\folder" for %%a in (*.xts) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a" ) for %%a in (*.mtx) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a" ) ( OR ) If there is no risk of a CRC Error of it grabbing at its own temp file use a *.* to test all at the location by which this is executed, where the batch is executed from a location say at C: which then the instructions of the batch switch the target to C:\folder as you have on the 2nd line. Code: [Select]echo off cd "c:\folder" for %%a in (*.*) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a" )My original code has a problem - due to a bug in the for command - and adding an extension as I described below will also fix that issue. You can process different filetypes using a single for loop and the ren command keeps the original extension but adds an extra one - and that extra one is removed after all files are processed, by the last ren command. Code: [Select]echo off cd "c:\folder" for %%a in (*.mtx *.xts) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a.final" ) ren *.final *. Thanks Foxidrive ... I am going to try this out today on the PC of the system. Going to make a backup copy of the files first just in case, but looks like it should work as intended. Didnt know that a FOR loop could have ( *.mtx *.xts ) like this. I was thinking that for a single FOR loop it might need to be 2 separate ARGUMENTS like an OR condition such as ( *.mtx ) || ( *.xts ) otherwise it would take *.mtx *.xts as a single string vs testing for one or the other file types. Learned something new. Will let you know how it went in a reply back later. Thanks for your help on this! Just tested it and it looks like maybe there is an issue with this batch and NT4 not supporting it or some other issue. Command Shell Window goes black for about 10 seconds as its processing and then scrolls duplicate file found and then gets to the pause that I added in the batch so that the command shell window wouldnt close and I could see the messages. All but 4 config files at the C:\Machine1\Parameters\Sorts\ location for *.mtx and *. xts are changed to 0k files with contents wiped out and the 4 that weren't completely wiped out of all other parameters had LS: Y in the 1k files. The Files are normally like 37k in size and have all sorts of config parameters in them. I ended up reverting back from backup of the files so that I can try the batch again when a correction is made. In the folder where this is all happening there are 2 copies of each file with 2 different file extensions, but as stated above all but 4 files are wiped out of data and 0k in size. I have run into other difficulties with batch and NT4 so this wouldnt be the first time that a batch that should work and probably works fine on a newer NT based OS pukes on NT4. The last time I ran into issues with NT4 it was using the date and time calls which NT4 doesnt like %date% and %time%. I didnt add anything else to the batch you provided, I just changed the path as necessary for the target and added a pause at the end to see the last messages before close of the window as highlighted below. Quote echo off Thank You for your efforts on this and hopefully it doesnt make you want to pull your hair out like I have felt like doing with NT4 and batches in the past. The -NT4 OS on the subject line of this was to make it clear that its NT4 OS and is probably going to be picky with what it supports for instructions. My guess is that this batch either has a small typo that I am not seeing or needs to be tweaked to a legacy format that NT4 is fine with. EDIT: Was just thinking could there be a character in these config files that is causing the batch to go haywire such as these characters as for the config files are loaded with config info that uses special characters and HEX etc such as these characters [email protected]#$%^&*(){}[]~`';:"<>,.?/\|+=-_ Maybe I'm off the beaten path and its something else, but I have run into issues before with other scripts and the script hitting characters that cause issues, so figured I'd touch on this if its a concern or not. Maybe it doesnt matter what info is in the config files as for its only looking for the specific matches and no other characters can foul it up.Can you try this batch script? It works on W2K - and just creates a test folder and creates two files to test it with. See if any errors occur before the first pause and what they are. I don't have NT4 to test it with here. Code: [Select]echo off md "C:\Machine1\Parameters\Sorts\testdave" cd "C:\Machine1\Parameters\Sorts\testdave" ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.mtx ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.xts echo after file creation pause for %%a in (*.mtx *.xts) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a.final" ) echo before final rename ren *.final *. pause I'm not dave but I do have NT4. Not sure how useful that will be. I ran the batch file and it works without any error up to the first pause. After continuing I get a few errors: Code: [Select]Press any key to continue . . . A duplicate file name exists, or the file cannot be found. before final rename A duplicate file name exists, or the file cannot be found. A duplicate file name exists, or the file cannot be found. Press any key to continue . . . Thanks BC_Programmer, that is useful. I thought I'd traced a flaw but my brain must be out-to-lunch, as it was the same code. If you have time to test this then it may help locate the problem. Run this in an empty folder. Code: [Select]echo off :md "C:\Machine1\Parameters\Sorts\testdave" :cd "C:\Machine1\Parameters\Sorts\testdave" ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.mtx ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.xts echo after file creation dir pause for %%a in (*.mtx *.xts) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"tempnewfile.tmp" del "%%a" ren "tempnewfile.tmp" "%%a.final" ) echo =========== dir echo before final rename ren *.final *. pause If that fails can you try this version please? Code: [Select]echo off :md "C:\Machine1\Parameters\Sorts\testdave" :cd "C:\Machine1\Parameters\Sorts\testdave" ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.mtx ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.xts del "tempnewfile.tmp" 2>nul for %%a in (*.mtx *.xts) do ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" >>"tempnewfile.tmp" echo LS: Y if "%%b"=="$LASTSORT N" >>"tempnewfile.tmp" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" >>"tempnewfile.tmp" echo %%b ) del "%%a" ren "tempnewfile.tmp" "%%a.final" ) ren *.final *. pause First Batch Output: Code: [Select]C:\test2>test after file creation Volume in drive C has no label. Volume Serial Number is C875-5A5F Directory of C:\test2 06/26/15 03:22a <DIR> . 06/26/15 03:22a <DIR> .. 06/26/15 03:22a 36 aaa.mtx 06/26/15 03:22a 36 aaa.xts 06/26/15 03:20a 693 test.bat 5 File(s) 765 bytes 3,810,073,600 bytes free Press any key to continue . . . ECHO is off. Volume in drive C has no label. Volume Serial Number is C875-5A5F Directory of C:\test2 06/26/15 03:22a <DIR> . 06/26/15 03:22a <DIR> .. 06/26/15 03:22a 7 aaa.mtx.final 06/26/15 03:22a 7 aaa.xts.final 06/26/15 03:20a 693 test.bat 5 File(s) 707 bytes 3,810,073,600 bytes free before final rename A duplicate file name exists, or the file cannot be found. Press any key to continue . . . Second batch: Code: [Select]C:\test2>test The system cannot find the file specified. Could Not Find C:\test2\aaa.mtx The system cannot find the file specified. Could Not Find C:\test2\aaa.mtx Could Not Find C:\test2\aaa.mtx The system cannot find the file specified. The system cannot find the file specified. Could Not Find C:\test2\aaa.xts The system cannot find the file specified. Could Not Find C:\test2\aaa.xts Could Not Find C:\test2\aaa.xts The system cannot find the file specified. A duplicate file name exists, or the file cannot be found. Press any key to continue . . . After the second batch file ran there were two files in the same folder as the batch file, "aaa" and "aaa.xts.final" I did some tests myself here and compared with Windows 2000, and I think the difference (or perhaps one of many) may be that in NT4, rename appears to work differently. with two files test.xts.final and test2.xts.final, for example, on Windows 2000 (and presumably later) ren *.final *. will rename them to test.xts and test2.xts respectively. However, on NT4 it renames them to test and test2- removing the extension entirely. Thanks again BC_Programmer, it is that final rename - a change as Windows versions flew past. This may work - touch wood. It relies on the filenames NOT having a plus + sign in them. Code: [Select]echo off :md "C:\Machine1\Parameters\Sorts\testdave" :cd "C:\Machine1\Parameters\Sorts\testdave" ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.mtx ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.xts for %%a in (*.mtx *.xts) do ( ( for /f "delims=" %%b in ('type "%%a"') do ( if "%%b"=="LS: N" echo LS: Y if "%%b"=="$LASTSORT N" echo $LASTSORT Y if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b ) )>"%%a+tmp" del "%%a" ) echo ===== before rename & dir & echo ===== before rename & pause for %%a in ("*+tmp") do ( for /f "delims=+" %%b in ("%%~a") do ren "%%~a" "%%b" ) echo done pause Thanks BC to providing the NT4 environment testing for Foxidrive on this issue. Will be checking back here periodically on when you want me to test on the live system. Thanks for both of your help on this.No error this time: Code: [Select] ===== before rename Volume in drive C has no label. Volume Serial Number is C875-5A5F Directory of C:\testdata 06/26/15 04:41a <DIR> . 06/26/15 04:41a <DIR> .. 06/26/15 04:41a 7 aaa.mtx+tmp 06/26/15 04:41a 7 aaa.xts+tmp 06/26/15 04:39a 710 test.bat 5 File(s) 724 bytes 3,810,054,656 bytes free ===== before rename Press any key to continue . . . done Press any key to continue . . . The files don't seem to get renamed at the last step, though- both aaa.mtx+tmp and aaa.xts+tmp remain. Quote from: BC_Programmer on June 26, 2015, 06:44:55 AM No error this time: Hmm - can you please show us what this prints to the console? Code: [Select]echo off ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.mtx+tmp ( echo $LASTSORT N echo PL120 echo LS: N echo dostips )>aaa.xts+tmp for %%a in ("*+tmp") do ( echo "%%~a" for /f "tokens=1 delims=+" %%b in ("%%~a") do echo ren "%%~a" "%%b" ) echo done pause |
|
| 25. |
Solve : How do I find a hex string? |
|
Answer» I'm guessing the ones giving two NUMBERS indicate the CURRENT value with the FIRST of the pair. So "00004F0B: 28 90" means the current value is 28 and it should be 90.Oh of course, that makes sense! Thank you. |
|
| 26. |
Solve : xcopy problem from one mem card > PC > new mem card? |
|
Answer» Quote from: foxidrive on July 26, 2015, 04:45:31 AM The issue is that files have attributes and some are system and hidden files. This is true. However, their original command includes the appropriate /H switch. The 'fixed' version does not. I can think of no difference between /S /E /V (The "working" version) and /S /I /E /H /Y /O that would cause the former to work, and the LATTER to not. The only difference is the target specification. Quote from: NorrinRadd on July 26, 2015, 06:13:05 PM Thankfully You're WELCOME. Quote from: BC_Programmer on July 26, 2015, 11:48:07 PM This is true. However, their original command includes the appropriate /H switch. The 'fixed' version does not. You're absolutely right. In fact the "working" one has /S and /V which have absolutely no effect on what is copied at all, and it doesn't copy hidden or system files. Quote from: patio on July 25, 2015, 11:03:02 PM I suspect he was never for a solution... It's looking very much that way.Well if you're going to come after me like that twice now foxidrive then I'll respond. The "thankfully" was earned by the poster on the toms forum, not you; your "It's looking very much that way" is your own snarky reaction to a legitimate question posted to this forum and the workable answer having come from a different forum. You seem to take this personally, you shouldn't. I didn't care who answered it, just needed the fix, got it, reported that back responsibly. Posters like BC_Programmer add value to the thread. I'm replying here to clear the air in this thread for future readers that may be misled by NorrinRadd's misunderstanding, and his total lack of ability to test the command lines, to confirm for himself if what he believes is true. His claim is that this command line will copy every file from a source to target - where in actual fact it will fail to copy hidden and system files - as pointed out by BC_Programmer xcopy G:\*.* /S /E /V This command line will copy exactly the same files, because /E does the same as /S but also copies empty folders - and adding /S does nothing EXTRA. xcopy G:\*.* /E The /V switch does absolutely nothing except to check if each copied file is the same size - it doesn't verify the file contents that are being copied, despite being called the verify switch. The commands above will not give a complete copy of all files regardless of file attributes. The command line I provided for modern versions of Windows will create a mirror backup of all files including hidden and system and empty folders - and removes any extra or different files or folders on the target location (which is F: below) robocopy e:\ f:\ /mir We can only assume NorrinRadd's first failed attempt is due to hidden and system files, but it could have been a number of unrelated reasons, such as aborting the batch file/command line for one. If he runs a test using the commands above then he can verify the truth of what I say for himself. I won't hold my breath. Quote from: foxidrive on July 29, 2015, 03:45:14 AM We can only assume NorrinRadd's first failed attempt is due to hidden and system files, but it could have been a number of unrelated reasons, such as aborting the batch file/command line for one.The original Command Line did in fact have the /H switch, so my "theory" is that it was the typo in the target specification, as I noted. Though it was stated they tried all sorts of combinations (which they didn't really describe at the time), it would be consistent with what we've been told, I think; the only alternative would be xcopy ignoring switches and just doing what it wants. 1. standard copy from Windows Explorer Copy/Paste. This wouldn't copy hidden or system files (uness they were set to be visible, I think). This would be seen. 2. Original xcopy attempts. The command lines they used would copy to an L directory/folder, and not to the L: drive. The files on L: would remain unchanged, still being the same as the results from the Copy Paste, since the files would not be being copied there. 3. the "Fixed" one actually working as claimed leaves me rather stymied. It seems likely they fiddled with it a bit, and that it was not the actual command they ran, but rather a variant where they added extra switches. Quote from: BC_Programmer on July 29, 2015, 09:20:10 AM The original Command Line did in fact have the /H switch, so my "theory" is that it was the typo in the target specification, as I noted. I saw when you mentioned that and forgot to have a look. I just did so and giggled as you're quite right and the fellow had no clue, yet got all aggressive about everything. Quote 3. the "Fixed" one actually working as claimed leaves me rather stymied. It seems likely they fiddled with it a bit, and that it was not the actual command they ran, but rather a variant where they added extra switches. Yeah. Finger TROUBLE. Quote from: BC_Programmer on July 29, 2015, 09:20:10 AM The original Command Line did in fact have the /H switch, so my "theory" is that it was the typo in the target specification, as I noted. Though it was stated they tried all sorts of combinations (which they didn't really describe at the time), it would be consistent with what we've been told, I think; the only alternative would be xcopy ignoring switches and just doing what it wants. Thanks BC_Programmer, I will try to address your points: The variations I tried I did describe, perhaps not clearly, where I mentioned the "L" vs. "L:" and "\L" and "\L:" permutations. I didn’t reformat the card after each attempt, and ran the commands one after the other, so that might account for your theory assertion. In the end I reformatted the card once more before using the tomshardware command. I didn’t fiddle with that and ran it exactly as posted. No alleged “Finger trouble”. ================================ Two other things – format and DIR I mentioned there is another consideration, and wonder why no one asked or if it is in fact a factor - the manner of formatting the card before the copies. Before the tomshardware string I tried long form format and quick format, and at the time wondered if there was anything to consider regarding FAT vs. NTFS or some other formatting and if that was the cause of the initial problem. The last format I did before the successful command was a quick format. The xcopy command output said 24k files were copied, after that the DIR command showed far less, I put it out there to see if maybe I was doing something wrong with the DIR command to show all the files. No one said anything about it so I guess not. ================================ So hey, foxidrive, had I seen your robocopy command before the tomshardware one I would have certainly tried it out, it was just down to the timing. After that there was no reason to do it again with a different command. I started using the phone and the contents of the card changed from that point. Calling me out with “got all aggressive about everything” whilst peppering your responses with that amount of condescending and pejorative language “Claim” “You're welcome.” “thankfully” “It's looking very much that way” ”total lack of ability” ”giggled” “the fellow had no clue,” won't hold my breath”, etc. is a bit pot/kettle/black. I didn’t ‘claim’ anything – I stated the issue, posted what I tried, the failures, and the results. Though while putting on a negative spin on how I attempted and achieved what I set out to do and posturing yourself as Guardian Of Future Readers, there is nothing in my content that should mislead and certainly was not my intent - I have been completely transparent in my purpose, my failed attempts, and what I did to resolve it. You seem to read into things that are not there - it may be an ego thing, a comprehension thing, or just pure misunderstanding. You seem to struggle with this and look for opportunities to be adversarial and vitriolic. And so I respond in kind. The commands above will not give a complete copy of all files regardless of file attributes. I admitted then I didn’t know why what I tried at first didn’t work to try and understand it, and I admit now I don’t know why what I did in the end worked. It is less “what he believes is true” and more the results. The noob in me bows to your DOS prowess, but unless what DIR is telling me is wrong and hence my question at the top of this post, the reality is all the files, dirs and permissions came over with that tomshardware command. While I had an interest to understand the commands better while I still had the problem, once it was solved I no longer had that interest, and for future card upgrades I would most likely use the same command or try that robocopy suggestion. So questions to the almighty foxidrive: did you try these commands, do DIRs after them, and get different results? Why did the tomshardware advice work the first time on a freshly-formatted card? As the test can be done with any memory card, there is no real reason for me with my cards to do it. When you can answer these then you can take the pebble from my hand. You may well be a Good Guy on this forum, but as pretty much everyone puts their foot in it at some point, it’s about how you pull your foot out that people will remember you for. Formatting option wouldn't really matter- drive should be clear or equivalent either way. NTFS/FAT32 might make a difference since in your original command you specified the option to copy ACLs (permissions) which is only supported on NTFS, though I doubt that would cause files to just not be copied. Quote from: NorrinRadd on August 01, 2015, 12:18:57 AM The xcopy command output said 24k files were copied, after that the DIR command showed far less, I put it out there to see if maybe I was doing something wrong with the DIR command to show all the files. No one said anything about it so I guess not. Actually I had written about that originally but I removed it because I thought it looked douchey, but the command in the OP, "dir /ad-h" will explicitly show everything except hidden files, as seen in the dir /? (- being a prefix meant to exclude an attribute). I had forgotten about it myself and moved forward with the assumption that the files were not being copied when it may be that the dir command you were using that was not showing them. After your original reply regarding the L/L:/etc. I must admit I thought of it again but I at that point I perhaps unfairly expected you might say you had tried other combinations as well in the same manner. Quote did you try these commands, do DIRs after them, and get different results? Why did the tomshardware advice work the first time on a freshly-formatted card?I know this isn't directed at me but I did (as best I could) and that is what led to my original L versus L: stuff. Now, that said, I couldn't nearly reproduce your situation because I don't have any Smartphones or such that would have a similar folder structure, so the best I could do was with fake data with a few hidden files and such. Really, the command you listed as working explicitly doesn't copy hidden or system files, thus why we aren't able to "accept" that it was a solution, so We (well, I'm) thinking perhaps another factor led to it seeming to work. Possibly CHANGING how you verified the file copy? Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM Formatting option wouldn't really matter- drive should be clear or equivalent either way. NTFS/FAT32 might make a difference since in your original command you specified the option to copy ACLs (permissions) which is only supported on NTFS, though I doubt that would cause files to just not be copied.Thansk for clearing that up, and what confuses it more is that I first copied using cut&paste which invoked TeraCopy, then for each or almost each successive attempt I created a new Dir on my PC to get the files there. Now I can't remember if I tried a copy from one card to another card and bypassing the PC. One other thing is as I tried so many options I'm not sure if one of the formats I did was on the phone itself, not mounted by the PC and run from a cmd window. Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM Actually I had written about that originally but I removed it because I thought it looked douchey, but the command in the OP, "dir /ad-h" will explicitly show everything except hidden files, as seen in the dir /? (- being a prefix meant to exclude an attribute). I had forgotten about it myself and moved forward with the assumption that the files were not being copied when it may be that the dir command you were using that was not showing them. After your original reply regarding the L/L:/etc. I must admit I thought of it again but I at that point I perhaps unfairly expected you might say you had tried other combinations as well in the same manner. I did try a few Dir switches, but aside from that, what confuses me is why the copy command in the OP has the output that 24k files got copied over to the PC folder, but when I DIRed that folder there was less than half were there (I think I still have that output) and the overall size was only !3gb out of the !6gb resident on that card. Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM I know this isn't directed at me but I did (as best I could) and that is what led to my original L versus L: stuff. Now, that said, I couldn't nearly reproduce your situation because I don't have any Smartphones or such that would have a similar folder structure, so the best I could do was with fake data with a few hidden files and such. Well I do still have the original 8gb card with the original content. I don't have another card beside the one in my phone and I don't want to mess with that now, but could try copying to PC in a new folder. Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM Really, the command you listed as working explicitly doesn't copy hidden or system files, thus why we aren't able to "accept" that it was a solution, so We (well, I'm) thinking perhaps another factor led to it seeming to work. Possibly changing how you verified the file copy?Yes I think that is possible, I should have that output |
|
| 27. |
Solve : Kudos for DOS Forum? |
|
Answer» Quote I tried it, and it produced the error message " 'typ' is not recognized as an internal or external command, operable program or batch file. ", but it still executed the command to completion!Only incidentally. Code: [Select]typ nul > somefile.txtSays to execute the command "typ nul" and redirect the standard output to "somefile.txt". since typ is not a command, the command fails, the message prints to the standard error stream, and then the standard output is redirected to the file, which in this case means nothing gets redirected, which incidentally is what the original command was intended to do. The only functional difference between: Code: [Select]type nul > somefile.txt and Code: [Select]geeble gobble > somefile.txt is that the latter will produce an error message in addition to redirecting nothing to the file.Thanks for the CLARIFICATION. I see it now. Two separate results of any (is it accurate to say any?) command. It's like this: Code: [Select]geebles gobble but they don't gob down > somefile.txt Quote from: stew2652 on November 19, 2014, 06:57:56 AM Interesting. I did not execute this PARTICULAR command in a batch. I issued it directly at the command LINE, and it produced the error message I stated. No matter where you issued the command, it still failed. Quote but it still executed the command to completion! Just to clarify, this is the bit that it didn't do. |
|
| 28. |
Solve : Moving Prompt Screen? |
|
Answer» I expect people to USE the code i have given, in the context that has been specified. They are FREE to use in any other context if they wish but any results from that are entirely at their own RISK. |
|
| 29. |
Solve : Find and Replace with a dynamic string search? |
|
Answer» Quote from: BC_Programmer on December 24, 2010, 01:09:55 AM No. you said a "CSV Parsing Library". Now if you really meant a "text processing library that happens to include CSV parsing capabilities" then that would make a bit more sense. Generally when you have one library that does a single overly-concise task (such as CSV parsing) it often turns the whole thing into some kind of sick over-complicated joke.when i said a library, i meant things like the csv library that comes with Python, or the Text:CSV library for Perl. What kind of library do you think i am talking about? Quote from: Salmon Trout on December 24, 2010, 01:37:26 AM This is what he asked for. (Yes I know NT family cmd is "not DOS").I believe most who post here does not use DOS 6.22 any more, and there is no indication that OP wants it to be a PURE batch script, where you only can use what's provided by cmd.exe ( note, "PURE batch script" does not include external tools , even those installed by default). this is also called a DOS batch script. (note, the word PURE is omitted) Code: [Select]echo off ...... gawk -F'"' '{for(i=2;i<=NF;i+=2) gsub(",","",$i); }1' OFS='"' myfile > newfile move newfile myfile for %%a in ( 'cscript //nologo myscript.vbs' ) do ( ...... ) .... Quote from: ghostdog74 on December 24, 2010, 05:41:20 PM (note, "PURE batch script" does not include external tools , even those installed by default). Tha... that doesn't even make sense... it's like saying a "pure instruction booklet does not contain instructions". I mean, I understand what you're saying, that a "Pure Batch script" only uses commands inherent to cmd.exe, but that sort of goes against the whole point of a "batch" script- a series of instructions. trying to add arbitrary separations of what constitutes "pure and unpure" is pointless. By that very definition no programming language is pure because they all call into the native libraries, somehow there is some ethereal distinction where you can use language features like C/C++ extern procedures and dll/.so importing in many others and your code is no longer "pure" but if you use functions of the language itself which call into those same OS specific features you're code is "unpure" I mean, yes, your code might be less portable, but less "pure"? That's rather silly. Quote DOS batch scripta DOS batch script is simple. a batch file that runs on a standard DOS installation. Therefore you can use choice, fc, diskcomp, whatever. It's still a standard DOS installation and a "DOS batch script" would work just FINE. A "DOS Batch script" doesn't have to exclude uses of fc, diskcomp, find, more, sort, etc. to count. Of course about 90% of the time people seem to get this idea that, you know, despite it not being mentioned anywhere that the command prompt is DOS in the actual software, they think it's called DOS. "ohhh! black screen... white writing! OMG it must be DOS! it couldn't possibly be powershell or bash or any number of other applications and shells that display that exact same theme by default but operate entirely differently. Quote from: BC_Programmer on December 24, 2010, 06:09:37 PM but that sort of goes against the whole point of a "batch" script- a series of instructions.No, that's exactly what i am trying to illustrate. a batch script is just a series of instructions to perform job, whether those instructions comes from internal shell or external tools doesn't matter. that said, what OP wants is just a series of commands in a batch file, so using gawk or any other external tools to perform the job is fine.! Quote That's rather sillytell that to ST in post #14. Quote trying to add arbitrary separations of what constitutes "pure and unpure" is pointless. By that very definition no programming language is pure because they all call into the native libraries, somehow there is some ethereal distinction where you can use language features like C/C++ extern procedures and dll/.so importing in many others and your code is no longer "pure" but if you use functions of the language itself which call into those same OS specific features you're code is "unpure" I mean, yes, your code might be less portable, but less "pure"? That's rather silly.useless babble, not going to bother with it. Quote from: ghostdog74 on December 24, 2010, 06:43:26 PM No, that's exactly what i am trying to illustrate. a batch script is just a series of instructions to perform job, whether those instructions comes from internal shell or external tools doesn't matter. that said, what OP wants is just a series of commands in a batch file, so using gawk or any other external tools to perform the job is fine.! ahh, so I can provide this as a solution: Code: [Select]echo off csc /out:findrep.exe findrep.cs findrep %1 %2 Quote from: BC_Programmer on December 24, 2010, 07:13:04 PM why not? its perfectly fine if there's a c sharp COMPILER installed. However, you don't want to do this because why would you want to compile it every time you run the batch ? Plus, if you were to distribute the batch, its dependent on whether a csc compiler is installed. Just compile it once, then distribute the exe will do. |
|
| 30. |
Solve : MS Dos bat file failure on first character? |
|
Answer» Hi, I have a problem in that every .bat file i run fails because the there is an invisible character inserted at the beginning This is the clue: Quote '?p' is not recognized as an internal or external command, operable program or batch file. Diagnosis: file saved as UNICODE. (Tested, reproduced) Solution: save file as ANSI. (Ditto) Salmon TROUT, you rock! Salmon Trout, you definately rock and are da' man, da' fishes, the da' whatever you want to be. And i was the butler in this who-doneit all along. As Monk, (if you ever saw the TV show), would say: " here's what happened". I MUST have, at one time, started to make a batch file from a ".txt" file i had saved once from the C# visual studio IDE or somthing like that. Once i had the problem, I kept editing it with notepad even to the point of blanking out the file and then typing in "pause" for the test. The fly was already baked in the ointment. No amount of editing with notepad will fix it. I just made a text file the C# express IDE and confirmed that it does "mess" up the file. I "blanked" out the file and I did a file compare with a blank file i had just made from notepat and the compare utility showed the "invisible" character as a diff. This one was driving me crazy and I was coming to the point that i had to have it figured out. THANKS TO ALL THAT WEIGHED IN AND ESPECIALLY THE BIG FISH IN THE BIG POND |
|
| 31. |
Solve : problem with qbasic...,? |
|
Answer» First sorry for my bad english, |
|
| 32. |
Solve : unsure how to execute this timed batch? |
|
Answer» I plan to place a shortcut to my streamrecorder in my startup folder so it RUNS when windows starts. how would i structure my batch so it runs when windows starts but only if its between 7:00 pm and 9:00 pm. I don't want to use scheduler because if there'a a power cut at say 6:58 and power returns at 7:02 i want my stream recorder to still kick in. Any ideas guys. runnin XP by the way. Here's the info u asked for 1:53:45.32. I use the 12 hour clock format. no 'am' or 'pm'? ok i re-entered the echo %time% at 8:28 pm, i got 20:26:22.00So, this is what you want. echo off set tme=%time::=% if %tme% GEQ 190000.00 if %tme% LEQ 210000.00 start streamrecorderthanks guys will give it a shot. HaxxxIf it doesn't work, remove the .00 from the if commands. |
|
| 33. |
Solve : Multi user batch file, Multi player batch game, start problems, saving problems?? |
|
Answer» I WANT to make my batch game have MUSIC, be multiplayer and save your progress. Please help with any that you can, including the multiplayer.OK, what have you got now?Multi PLAYER problems. Multi player problems.I mean what is your current code...CURRENTLY (but still in devlopment): ::TO DO: ::1.Finish screens. ::2.Finish items. ::3.Get a skill. ::4.Add my engines. ::5.Make a reference. ::6.Finish the game map. echo off :BOOLEAN set spritewing=0 set hammer=0 set hppotion=0 set mppotion=0 set orange=0 set rose=0 set sword=0 if %sword%==1 playerattack=%playerattack%+15 set shield=0 if %shield%==1 playerdefense=%playerdefense%+15 set spritedust=0 goto VARIABLES :VARIABLES set playerhp=25 set playerattack=5 set playerdefense=10 set lightspritehp=5 set lightspriteattack=3 set lightspritedefense=2 set darkspritehp=5 set darkspriteattack=3 set darkspritedefense=2 set waterspritehp=5 set waterspriteattack=3 set waterspritedefense=2 set firespritehp=5 set firespriteattack=3 set firespritedefense=2 set windspritehp=5 set windspriteattack=3 set windspritedefense=2 set lightningspritehp=5 set lightningspriteattack=3 set lightningspritedefense=2 set mindspritehp=5 set mindspriteattack=3 set mindspritedefense=2 set earthspritehp=5 set earthspriteattack=3 set earthspritedefense=2 set livingredwoodhp=15 set livingredwoodattack=11 set livingredwooddefense=7 set livingoakhp=10 set livingoakattack=6 set livingoakdefense=3 set livingmaplehp=13 set livingmapleattack=8 set livingmapledefense=5 set elfhp=20 set elfattack=10 set elfdefense=13 set traphp=1 set trapattack=10 set trapdefense=0 set babyspiderhp=10 set babyspiderattack=10 set babyspiderdefense=10 if %playerhp%==0 goto PLAYERDEAD if %lightspritehp%==0 goto LIGHTSPRITEDEAD if %darkspritehp%==0 goto DARKSPRITEDEAD if %waterspritehp%==0 goto WATERSPRITEDEAD if %firespritehp%==0 goto FIRESPRITEDEAD if %lightningspritehp%==0 goto LIGHTNINGSPRITEDEAD if %windspritehp%==0 goto WINDSPRITEDEAD if %mindspritehp%==0 goto MINDSPRITEDEAD if %earthspritehp%==0 goto EARTHSPRITEDEAD if %livingoakhp%==0 goto LIVINGOAKDEAD if %livingmaplehp%==0 goto LIVINGMAPLEDEAD if %livingredwoodhp%==0 goto LIVINGREDWOODDEAD if %babyspiderhp%==0 goto BABYSPIDERDEAD if %traphp%==0 goto TRAPDEAD if %elfhp%==0 goto ELFDEAD goto MAIN :MAIN start "/min" "c:\Users\Owner\Desktop\ALL\Exploration72\drumdance.mp3" set n=North set s=South set e=East set w=West echo Welcome to the Exploration 72 alpha testing. There is 1 monster, 1 class, 1 area, 1 item and 1 skill. echo To go to the game, type in P and press ENTER. echo To exit, type in E and press ENTER. echo To look in the instructions, type in I and press ENTER. echo To look in the reference, type in R and press ENTER. set /p input=COMMAND? if %input%==P goto LOGIN if %input%==E goto EXIT if %input%==I goto INSTRUCTIONS if %input%==R goto REFERENCE :EXIT cls pause exit :INSTRUCTIONS cls echo In this game you create your character and you can explore the text based world, hunt monsters and level up. pause goto MAIN :REFERENCE cls echo Sorry, there is currently no reference as the game is so small pause goto MAIN :LOGIN cls echo Enter your password: set /p input=Password: if %input%==MOMMY1 goto CHARACTERCREATION :CHARACTERCREATION cls echo Enter your characters name: set /p name=Name: pause goto CLASS :CLASS goto STR :STR cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p STR=Roll: pause goto INT :INT cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p INT=Roll: pause goto WIS :WIS cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p WIS=Roll: pause goto END :END cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p END=Roll: pause goto DEX :DEX cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p DEX=Roll: pause goto AGI :AGI cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p AGI=Roll: pause goto LUK :CHA cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p CHA=Roll: pause goto LUK :LUK cls echo Roll a 6 sided die, then multiply by three. What is your outcome? set /p LUK=Roll: pause goto DESCRIPTION :DESCRIPTION cls echo Enter a description for your character. set /p description=Description: pause goto EYE :EYE cls echo Type in your eyes. echo ,,o,0,*,O,.,?,!,,#^,,+,=,-,_,v,V,'," set /p eyes=Eyes: pause goto NOSE :NOSE cls echo Type in your nose. echo o,*,[email protected],#,O,.,,,',",?,,v,V set /p nose=Nose: pause goto MOUTH :MOUTH cls echo Type in your mouth. echo ,o,O,!,,#,.,,,',",?,,v,V set /p mouth=Mouth: pause goto FINI :FINI cls echo Your result is this: echo Name: %name% echo description: %description% echo STR: %STR% echo INT: %INT% echo WIS: %WIS% echo DEX: %DEX% echo AGI: %AGI% echo LUK: %LUK% echo END: %END% echo CHA: %CHA% echo Portrait: echo %eyes% %eyes% echo %nose% echo %mouth% pause goto FOREST1 :FOREST1 cls echo ***** echo ******* echo ********* echo *********** echo ********** echo ******** echo ****** echo | | echo | | echo | O | echo | | echo | | echo | | echo / \ echo __/ \__ echo You have newly entered the world. You are in a forest. set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :ROSE cls echo You have stumbled upon a rose. Do you wish to pick it up? set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :MPPOTION cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :ORANGE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :HAMMER cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :SHIELD cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :FOUNTAIN cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :BABY_SPIDER cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :SWORD cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :DEAD_GOBLIN cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :SHIELD cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :GOBLIN cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :LIVINGOAK cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :LIVINGMAPLE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :LIVINGREDWOOD cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :LIGHTSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :DARKSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :FLAMESPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :WATERSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :LIGHTNINGSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :WINDSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto : :MINDSPRITE cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :MERCHANT cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :TRAP cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto :NATIVEELF cls echo set /p input=N, E, S or W? if %input%==N goto if %input%==E goto if %input%==S goto if %input%==W goto Ok, first off, I suggest you start off WAAY SMALLER. Judging by your code, you need to take smaller steps and learn as you go, instead of jumping into the world of batch scripting head-first. If you really want to make a batch game now, just do the absolute basics. Health and attack. Don't worry about STR, LUK, faries, shields, etc. until you learn how to do the small version properly first. If you need GUIDANCE, that's what we're here for. You don't have to take my advice, but trust me, you will thank me when you finish your batch game and it works. |
|
| 34. |
Solve : No Pop Up In Batch.? |
|
Answer» When You Run A Batch File. What "pop up"?Another person who wants to run a batch in "ghost-mode"... Quote from: Helpmeh on February 14, 2010, 03:42:18 PM Another person who wants to run a batch in "ghost-mode"... SOUNDS spooky to me. Quote from: Salmon Trout on February 14, 2010, 03:44:27 PM Sounds spooky to me.BOO! Lol... programer, at CH we really don't trust people who ask for a way to hide the COMMAND window. It's not because of you, we just can't provide a way in public, where people with malicious intents can use it. Quote from: Helpmeh on February 14, 2010, 03:51:41 PM malicious intents can use it.OK Ok. Quote from: programer on February 15, 2010, 03:52:25 AM Ok Ok. It's not a state secret to discuss how to hide a command window, and indeed in another thread I asked whether it was OK to post a batch file which included this. It all depends on why you want to do it. You have not said what your purpose is. Code: [Select]echo off if "%1" equ "-h" goto begin start mshta vbscript:Execute("moveTo screen.Width,0:CreateObject(""WScript.Shell"").Run """"""""&""%~f0""&"""""" -h"",0:close") goto :eof :begin winverPrince_, did you even read our posts?in a curious twist the CHM engine was severely crippled in WINDOWS 7, so I'm not sure the html help stuff used with batch would work on it. |
|
| 35. |
Solve : batch or registry file to change location outlook looks first for an archive.pst? |
|
Answer» Hey, |
|
| 36. |
Solve : Hidden command windows - good or bad?? |
|
Answer» I am writing (have finished, really) a little batch that I am quite pleased with. It is a multi-threaded or multipart downloader. You know the KIND of thing. There are plenty of GUI programs that do this - Net Transport, GetRight, WxDownload, etc. But I wanted a command line solution that you just feed with a url and away it goes. |
|
| 37. |
Solve : How to change FDD letter A: to B:? |
|
Answer» Hi! No choices there... Quote change the parameters used with the USB floppy device driver to change the drive letter. Post your autoexec.bat and config.sys files.Here they are. With TXT extension. [Saving space, attachment DELETED by admin]hmm, well from what I can tell your USB floppy is being accessed through the usbaspi1.sys driver: Code: [Select]device=c:\dos\usbaspi1.sys /v /u After some searching, I was able to find what I believe are the switches for this driver: Quote device=[{path}]USBASPI.SYS [/e] [/o] [/u] [/w] [/v] [/l[=n]] [/f] /r] [/slow] [/nocbc] [/norst] [/noprt] The most immediately obvious issue here is that there is nothing done to provide the driver with a drive letter, nor a facility to do so. Only thing I can guess at this point is to try the /f switch. Thanks. I'll try later, here's 1:56am, but I'll report. MiroI think I let it like it is now. Standard FDD I'll use to boot from diskette - 'cause bedore loading USB driver is active, after not and has letter A: USB FDD I'll use to work - standard FDD is inactive and USB FDD has letter A: So, I'm satisfied. And really thanks for help and patience. Miro |
|
| 38. |
Solve : Remove the last part of a string? |
|
Answer» Is there a way to remove the last section of a STRING, divided by \? For example: Type FOR /? at the prompt and study the part about about variable modifiers. (Hint: %%~dpI)Ahh...thank you. So how would I use that with %1? %~dp1? Pre-post edit: I was right. Thanks salmon, I wasn't quite sure how to implement those. But how would I do that with REGULAR variables? Quote from: Helpmeh on February 20, 2010, 05:41:46 PM how would I do that with regular variables? Essentially you are splitting a string into two parts: (1) From the start to the final token delimiter, (2) the rest. Since DEALING with drives, paths and filenames is a pretty common task, cmd.exe has this built in. One way is to get the ordinary variable into a FOR metavariable... Code: [Select]echo off set var=C:\Documents and Settings\User\My Documents\folder_a\b.txt for /f "tokens=*" %%A in ("%var%") do set DriveAndPath=%%~dpA echo %DriveAndPath% ...or pass it to a called label "subroutine" Code: [Select]echo off goto start :getpath set DriveAndPath=%~dp1 goto :eof :start set var=C:\Documents and Settings\User\My Documents\folder_a\b.txt call :getpath "%var%" echo %DriveAndPath% You can have the "subroutine" anywhere in the script e.g. at the end but you need to be alert to ensure, with gotos or some other method, that you don't arrive at it by mistake. The %~N and %~x modifiers work on URLs as well. (The others do not give very useful values) Note that the string can be a fictitious one. Neither the file "C:\Documents and Settings\User\My Documents\folder_a\b.txt" nor its drive, path, folder, name, extension etc, have to actually exist. Using the date and size modifiers on a nonexistent file will return null (blank) results. Quote from: Helpmeh on February 20, 2010, 05:16:46 PM Is there a way to remove the last section of a string, divided by \? For example: vbscript, Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject") Set objArgs = WScript.Arguments strPath = objArgs(0) WScript.Echo objFS.GetParentFolderName(strPath) on command line, pass your path as arguments to the script Code: [Select]C:\test>cscript //nologo getpath.vbs "c:\Documents and Settings\Administrator\Desktop\shortcutlnk" c:\Documents and Settings\Administrator\Desktop More general method which can be used for strings which are not seen by cmd.exe as representing a path. Illustrates some things you can do with tokens, and you will see clues on how to get at various things, like the first, last, nth, penultimate tokens, count the tokens & so on... Code: [Select]echo off REM get all but last token set string=C:\Documents and Settings\User\My Documents\folder_a\b.txt REM MAY be useful set tokencount=1 REM this format can handle white space delimiter set "delimiter=\" REM If delim is a space do this REM set "delimiter= " REM Create temp string for result set ResultString= :startloop REM get the first token in %%A and the remainder in %%B for /f "tokens=1* delims=%delimiter%" %%A in ("%string%") do ( REM no trailing spaces! set "firsttoken=%%A" REM if remainder is blank then REM we have got to the end REM so exit if "%%B"=="" goto exitloop REM otherwise collect the remainder set restofstring=%%B ) REM add first token and delimiter to result string set ResultString=%ResultString%%firsttoken%%delimiter% REM Chop off first token set string=%restofstring% REM may be useful set /a tokencount+=1 REM go round again goto startloop :exitloop REM this is the last (unwanted) token set lastttoken=%restofstring% echo Result=%ResultString% |
|
| 39. |
Solve : A way to turn off the archive bit in every file in C:\? |
|
Answer» I need a way to TURN off the ARCHIVE bit in every file in C:\ including Hidden (and maybe System) but still leave those bits as is. I would like it to run unattended after being started thought the whole directory and sub directories such as c:\. I have done what you recommend to the point that this old Dell GX-1 with Win 98II does not have the VB Scripting installed. Win 98SE INCLUDES VBScript and the ActiveX Scripting Host. It might work with VBA, but VBA is totally different from VBScript, which, comes with the OS. unless you purposely uninstalled it it should still be there. Not sure exactly what is going on with the debug scripts(despite your thorough explanation, I'm dreadfully sleepy at the moment EDIT: and no, not because of the explanation.... ), but the archive attribute is hexadecimal 20... so, removing the archive attribute from FFFF would give you FFDF, which may work in place of the fffd you tried. Thanks again. I searched and only found "Vbscript.dll" on the disk. While years ago in my business I ran a unix system with a very powerful Business Basic App and used the Korn Shell frequently and have some very limited experince with VBA I have never used VBScript. If I start it what will I see to tell me it is running? Will it run through the complete c:\ directory each time or will it make adifference where I start it. I tried it on a test disk and it didn't give an error but don't know if it is doing anything or not. Is there a site on line that will give me enough information to understand the instructions, variables etc. to be able to run VBScipt and program with it? Snowman Quote To use it simply paste it into notepad, and then save it as a "VBS" file- preferably in the folder you wish to work with, or, even better a test folder to see if it works. then you should be able to double-click it to run it. It runs through the folder it's in.It appears to work fine. I just needed to copy the script to a file in the directory I want to clear before running it. Where can quickly find more information to use VBS? Again, Thanks for the extraordinary help. Snowman Quote from: Snowman on February 19, 2010, 04:15:54 PM Where can quickly find more information to use VBS? the MS REFERENCE material can be found here. First it's important to know the various "dialects" of the core Visual Basic language. First, we had "plain" Visual Basic, which was a development tool for windows. With a few changes any VBScript designed code or VBA code can usually be convinced to run in it. VBA is a version of Visual Basic that is used by office to create macros; it's almost identical to the "full" Visual Basic version, except all code is inside of the word/excel/powerpoint/etc document structure and it doesn't use the Visual basic runtime, so stuff from that run-time (a good number of functions and constants_ that you can use in the "full" visual basic product are unavailable in VBA. VBScript is essentially a "scriptified" version of Visual Basic. a large number of things were removed for a number of reasons. The idea was to replace the older batch code method of automating tasks with a "windows" version that was called the "windows script host" model. By default the Windows Script Host (WSH) allows you to use VBScript or Javascript to automate tasks, such as the VBScript I provided. You seem like your at least a little familar with the command line, so this might interest you. you can run Scripts from the commandline, and you can use "CScript.exe" which runs the script in a manner that allows it to output to the console, or via "WScript.exe" which will display messages boxes for most output functions and input functions, but does not create or use a command line window. Quote Again, Thanks for the extraordinary help.your welcome |
|
| 40. |
Solve : Problem with the folder name in a for command? |
|
Answer» Hi, It works I know it works... Glad to help. |
|
| 41. |
Solve : Issues with start command? |
|
Answer» Im creating a VB program and in that program I create a batch file that... |
|
| 42. |
Solve : The mode command.? |
|
Answer» I saw that in the game "D.E.A.D V2" they USED a mode command in the BEGINNING. What does it do and how can You use it (or how I can use it). |
|
| 43. |
Solve : My Batch game..? |
|
Answer» I released this here about 2 YEARS ago, here is a later and better version.. you can find it at odn.t35.com/dead , it hosts free source a compiled version, an installer source and a source for enemy CREATOR and ITEM creator thank you and ENJOY ! |
|
| 44. |
Solve : Batch AI, graphics and other impossible batch ideas? |
|
Answer» I have made boolean results using variables and arithmetic operators, but I still lack the AI, graphics (both are probably unattainable), and also, if possible a universal command, like maybe making something so that if the player ever wants to to just be able to press type in MAIN and goto the main page, no matter which screen they're on. Anything even CLOSE to any of those will be appreciated.Or how to make a patcher. Or maybe echo off A patcher, funny you should ask about that. I FOUND no humour value in his query. However I respect your right to feel amused. Continue. |
|
| 45. |
Solve : Batch Game Save? |
|
Answer» I am currently creating a batch game (297 lines of coding on my first DAY!!!) but I can't get it to save your progress. PLEASE HELP. ANYTHING WILL BE APRECIATED!!!We'll have to see the code to help.... name1 - progress1What i did in my batch game ,FOUND here odn.t35.com/DEAD , was have all game features set in variables, when save is pressed have all variables sent to a file similar to this... score 993 Then for load, i used for /f and seperated it as TOKENS.. so score WOULD become %%a and 993 would become %%b for example: for /f "tokens=1*" %%a in (savefile.txt) Do set %%a=%%b |
|
| 46. |
Solve : Multi file batch games?? |
|
Answer» How can I make them in files, LIKE to save stuff? I don't know any commands for it.You're attempting to make a batch game before you know how to add data? Check out my batch game, at ODN.T35.COM/DEADYour link is as it says...DEAD.Impressive... |
|
| 47. |
Solve : Run Windows Media Player in Background? |
|
Answer» Hi All, Thanks Helpmeh for your quick reply!Here is a link to download mplayer2.exe. It doesn't require any installation, just copy and past the following file into C:\Program Files\Windows Media Player\. mplayer2.cnt mplayer2.exe mplayer2.hlp mplayer2.inf mplayer2.pnf For some reason, the underlined file (mplayer2.exe) is the only file (in the list I gave) that is in my C:\Program Files\Windows Media Player\ folder, so copy that one first and try out my script. If it doesn't work, copy the rest. Where is the link? Quite strange...it must not have copied...lol http://www.infocellar.com/winxp/files/mplayer-winxp-files.zipmplay32 and sndrec32 can also play .wav files.Thanks Prince! Hi Helpmeh I've updated the batch to mplayer2.exe however I'm getting an error message that the entry point was not found. I've attached a jpg of the error message [Saving space, attachment deleted by admin]I really have never seen that error before. It might be because it is for XP, not vista. To make sure you don't have mplayer2.exe on you COMPUTER (other than the one I gave you), do a search for it, and if it already exists, then it should work with that version. there is no "mplayer2" included with windows vista. use Windows Media Player Classic: http://www.afterdawn.com/software/video_software/video_players/media_player_classic.cfm/v6_4_9_1__20080127_ the switches are pretty similar: Quote
so you would use: Code: [Select]<path to mplayerc>\mplayerc.exe /minimized "%UserProfile%\desktop\wavfiles\8point1.wav" /play /close Wouldn't /minimized go on the other side of the path, with the other switches? Quote Usage: mplayerc.exe "pathname" [switches]it doesn't matter.ok. |
|
| 48. |
Solve : formating a new hard drive and installing windows 7? |
|
Answer» I installed a new hard drive in my husbands computer and was going to install windows 7. I ended up formating the drive from the dos prompt (such as it is) but when I tried to transfer the system FILES it doesn't recognize the command. When I try to do the installation of windows 7 it fails because of missing system files. You need to BOOT to the Windows DVD to install. Set the DVD drive as the first item in the bios boot order.I did. aftert he failure the first time I got out to the dos prompt and ran the format command the drive was formatted but the /s didn't work. I figured that was ok after the format I would just transfer the sys to it. That didn't work. I tried again to boot and install windows 7 and it failed after a fashion. |
|
| 49. |
Solve : running executable? |
|
Answer» Hi everyone can I double click my batch file to let it launch some executable file? Sure, why not? I'm SURPRISED you didn't just try and see what would happen. Curious, but why did you convert your batch code into a .exe file? There is nothing to be gained and the conversion process adds overhead to your code. |
|
| 50. |
Solve : Batch Books and How much skill will I need?? |
|
Answer» I know that I'm not there yet, but within some time in my life I want to WRITE a book on text based GAME making with batch, but I still have a few questions. |
|