

InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your Microsoft knowledge and support exam preparation. Choose a topic below to get started.
1. |
Solve : secrect message batch? |
Answer» <html><body><p>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.<br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>set /p encode=WORD:<br/>set <a href="https://interviewquestions.tuteehub.com/tag/num-238002" style="font-weight:bold;" target="_blank" title="Click to know more about NUM">NUM</a>=0<br/><br/>:LOOPE<br/>call set tmpa=%%encode:~%num%,1%%%<br/>set /a num+=1<br/>for /f "tokens=1,2 delims==" %%a in (coder.bat) do (<br/>if "%tmpa%" equ "%%a" set enword=%enword%%%b<br/>)<br/>echo %enword%> code.txt<br/>if not "%tmpa%" equ "" goto LOOPE<br/><br/>echo ENCODE: %enword%<br/>set num=0<br/><br/>:LOOPD <br/>call set tmpa=%%encode:~%num%,2%%%<br/>set /a num+=2<br/>for /f "tokens=1,2 delims==" %%a in (coder.bat) do (<br/>if "%tmpa%" equ "%%b" set deword=%deword%%%a<br/>)<br/>if not "%tmpa%" equ "" goto LOOPD<br/><br/>echo DECODE: %deword%<br/>pause<br/><br/><br/>a=87<br/>b=63<br/>c=60<br/>d=52<br/>e=76<br/>f=39<br/>g=49<br/>h=38<br/>i=31<br/>j=93<br/>k=09<br/>l=82<br/>m=72<br/>n=69<br/>o=13<br/>p=74<br/>q=85<br/>r=10<br/>s=41<br/>t=26<br/>u=61<br/>v=07<br/>w=56<br/>x=32<br/>y=12<br/>z=19<br/> =05<br/>.=30<br/>?=90<br/>,=80<br/>=36<br/>#=03<br/>$=40<br/>%=08<br/>_=70<br/>+=01<br/>*=06<br/>-=20<br/>/=//<br/>'=''<br/>:=::<br/>"=""<br/>[=[[<br/>]=]]<br/>\=\\<br/>}=}}<br/>{={{<br/>1=55<br/>2=11<br/>3=88<br/>4=77<br/>5=00<br/>6=99<br/>7=22<br/>8=77<br/>9=66<br/>0=44My file is called "coder.bat" and the output file is "code.txt". The only weird thing is that it says "pause" after the decode text. This is what you see.<br/> Code: <a>[Select]</a>WORD:i like pie. <<<Your input<br/>ENCODE: 3105823109760574317630 <<<Code automaticly copyed to code.txt<br/>DECODE: goto START <<<Weard<br/>Press any key to continue . . .<br/><br/>WORD:3105823109760574317630 <<<Code you paste in<br/>ENCODE: 88554400771188554466229944002277885522998844 <<<What I call super coded<br/>DECODE: i like pie.goto START <<<The decoded text+pause<br/>Press any key to continue . . .<br/> Quote from: devcom on July 04, 2009, 03:29:44 PM</p><blockquote>lol Helpmeh you are 1337 <em>(<a href="https://interviewquestions.tuteehub.com/tag/read-619994" style="font-weight:bold;" target="_blank" title="Click to know more about READ">READ</a>. leet)</em> <br/></blockquote> Oh I know what 1337 is, but are you a h4x0r? but I'm not 1337 any more...baww!<br/><br/>OP<br/>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 <a href="https://interviewquestions.tuteehub.com/tag/put-11868" style="font-weight:bold;" target="_blank" title="Click to know more about PUT">PUT</a> 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.<br/><br/>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.<br/><br/>The goto.<br/> Code: <a>[Select]</a>if not "%tmpa%" equ "" goto LOOPD<br/><br/>echo DECODE: %deword%<br/><br/>goto START<br/>pause<br/><br/><br/>a=87<br/>It sends you here.<br/> Code: <a>[Select]</a>echo off<br/><br/>:START<br/>setlocal enabledelayedexpansion<br/>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 <a href="https://interviewquestions.tuteehub.com/tag/changeable-7374650" style="font-weight:bold;" target="_blank" title="Click to know more about CHANGEABLE">CHANGEABLE</a> to a nother number or even a letter if you so <a href="https://interviewquestions.tuteehub.com/tag/desire-949423" style="font-weight:bold;" target="_blank" title="Click to know more about DESIRE">DESIRE</a>. 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.<br/><br/><br/><br/>Version 3.3<br/><br/>[attachment deleted by admin]</body></html> | |
2. |
Solve : Folder Transfer Batch File? |
Answer» <html><body><p>Quote from: Law506 on August 01, 2008, 09:43:09 PM</p><blockquote>What command would I throw into the batch file to have it <a href="https://interviewquestions.tuteehub.com/tag/output-344913" style="font-weight:bold;" target="_blank" title="Click to know more about OUTPUT">OUTPUT</a> in the text file how many FOLDERS it moved?</blockquote> <br/>echo off<br/>cls<br/>echo -------------------------------------------------------------------------------------------------------- >>Transfer.txt<br/>date /t >>Transfer.txt<br/>time /t >>Transfer.txt<br/>echo This will transfer all folders in SCAN to the ALPHABETICAL SCANNED DOCUMENTS.<br/>echo To stop the process CLOSE this window.<br/>echo <a href="https://interviewquestions.tuteehub.com/tag/list-11333" style="font-weight:bold;" target="_blank" title="Click to know more about LIST">LIST</a> of Files Moved. >>Transfer.txt<br/>pause<br/><br/>setlocal enabledelayedexpansion<br/>set Source=C:\Scanned Documents\<br/>set Target=C:\Alphabetical Scanned Documents\<br/><br/><strong>set /a foldersmoved=0</strong><br/><br/>for /f "tokens=*" %%a in ('dir "%Source%" /ad /b') do (<br/> set Current=%%a<br/> xcopy "%Source%\%%a" "%Target%\!Current:~0,1!\%%a\" /S /D /Y /C >>Transfer.txt<br/> <strong>set /a foldersmoved=!foldersmoved!+1</strong><br/> )<br/><br/>echo End Of Copy, see Transfer.txt for list of moved files.<br/>echo End Of Copy. >>Transfer.txt<br/><strong>echo Folders moved: %foldersmoved% >> Transfer.txt</strong><br/>pauseAwesome, works like a charm just like I expected.<br/><br/>Thanks Again. Quote from: Law506 on August 01, 2008, 09:43:09 PM<blockquote>hey,<br/>program appears to be working like a charm, can't thank yall enough. I have modifed it a bit to output to a text file for a kind of record keeping thing. What command would I throw into the batch file to have it output in the text file how many FOLDERS it moved? or is this possible? I would be happy I guess with the number of files moved if that one is possible. <br/><br/>Thanks guys, appreciate it.<br/><br/>If anyone knows off the top of thier head, I am <a href="https://interviewquestions.tuteehub.com/tag/looking-1079184" style="font-weight:bold;" target="_blank" title="Click to know more about LOOKING">LOOKING</a> around for the info now, how to setup an error log for a file not transfered to throw into the batch file that would be awesome.<br/><br/>Here is the file that has been compiled and modified slightly.<br/><br/> Code: <a>[Select]</a>echo off<br/>cls<br/>echo -------------------------------------------------------------------------------------------------------- >>Transfer.txt<br/>date /t >>Transfer.txt<br/>time /t >>Transfer.txt<br/>echo This will transfer all folders in SCAN to the ALPHABETICAL SCANNED DOCUMENTS.<br/>echo To stop the process CLOSE this window.<br/>echo List of Files Moved. >>Transfer.txt<br/>pause<br/><br/>setlocal enabledelayedexpansion<br/>set Source=C:\Scanned Documents\<br/>set Target=C:\Alphabetical Scanned Documents\<br/><br/>for /f "tokens=*" %%a in ('dir "%Source%" /ad /b') do (<br/> set Current=%%a<br/> xcopy "%Source%\%%a" "%Target%\!Current:~0,1!\%%a\" /S /D /Y /C >>Transfer.txt<br/> )<br/><br/>echo End Of Copy, see Transfer.txt for list of moved files.<br/>echo End Of Copy. >>Transfer.txt<br/>pause<br/></blockquote> <br/>for /f "tokens=*" %%a in ('dir "%Source%" /ad /b') do (<br/> set Current=%%a<br/> xcopy "%Source%\%%a" "%Target%\!Current:~0,1!\%%a\" /S /D /Y /C >>Transfer.txt<br/> If %<a href="https://interviewquestions.tuteehub.com/tag/errorlevel" style="font-weight:bold;" target="_blank" title="Click to know more about ERRORLEVEL">ERRORLEVEL</a>%==0 (<br/> GOTO :EOF<br/> ) else (<br/> Echo The following file completed with %errorlevel% >> errorlog.txt<br/> )<br/>)what "following file"? Can't quite see how the filename gets echoed.<br/> Quote from: Dias de verano on August 03, 2008, 09:00:02 AM<blockquote>what "following file"? Can't quite see how the filename gets echoed.<br/><br/></blockquote> <br/>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<blockquote>but the dir /ad in the loop makes %%a a folder, not a file.<br/></blockquote> <br/>Yes you are <a href="https://interviewquestions.tuteehub.com/tag/correct-409949" style="font-weight:bold;" target="_blank" title="Click to know more about CORRECT">CORRECT</a> 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.<br/><br/>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.</body></html> | |
3. |
Solve : REG ADD Batch? |
Answer» <html><body><p>Quote from: nothlit on October 27, 2010, 06:37:17 PM</p><blockquote>If left as CMD it goes to what I would consider the normal global run without the Wow6432Node. <br/><br/>Would anyone know why?<br/><br/>Is it because the converter is 32bit and the OS is 64bit? Just trying to make sense of it. Thanks.<br/></blockquote> <br/>You do know there are two cmd.exe versions <a href="https://interviewquestions.tuteehub.com/tag/present-1163722" style="font-weight:bold;" target="_blank" title="Click to know more about PRESENT">PRESENT</a> in 64 <a href="https://interviewquestions.tuteehub.com/tag/bit-239224" style="font-weight:bold;" target="_blank" title="Click to know more about BIT">BIT</a> Windows? One 64 bit and one 32 bit?<br/><br/>64 bit... %windir%\system32\cmd.exe<br/>32 bit... %windir%\SysWoW64\cmd.exe<br/><br/>Below you can see I go from 64 to 32 bit cmd and back again. You can see how to check the version...<br/><br/> Code: <a>[Select]</a><a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>:\Users\Mike>%windir%\system32\cmd.exe<br/>Microsoft Windows [Version 6.1.7600]<br/>Copyright (c) 2009 Microsoft Corporation. All rights reserved.<br/><br/>C:\Users\Mike>echo %programfiles%<br/>C:\Program Files<br/><br/>C:\Users\Mike>%windir%\syswow64\cmd.exe<br/>Microsoft Windows [Version 6.1.7600]<br/>Copyright (c) 2009 Microsoft Corporation. All rights reserved.<br/><br/>C:\Users\Mike>echo %programfiles%<br/>C:\Program Files (x86)<br/><br/>C:\Users\Mike>exit<br/><br/>C:\Users\Mike>echo %programfiles%<br/>C:\Program Files<br/><a href="http://www.tipandtrick.net/2008/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/">http://www.tipandtrick.net/2008/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/</a><br/><br/>Thanks for that Salmon <a href="https://interviewquestions.tuteehub.com/tag/trout-661901" style="font-weight:bold;" target="_blank" title="Click to know more about TROUT">TROUT</a>. Good information, I had run across the separation before that windows had the two environments but during this whole <a href="https://interviewquestions.tuteehub.com/tag/thing-25656" style="font-weight:bold;" target="_blank" title="Click to know more about THING">THING</a> I really didn't think about it. Live and learn I suppose.</body></html> | |
4. |
Solve : How can we spot evil intent by a Poster?? |
Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: Carbon Dudeoxide on June 02, 2009, 06:30:30 PM<blockquote>deleting files is not hacking....<br/></blockquote> NOT EVEN CLOSE!<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> 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<blockquote> Batch can NOT be used for hacking.<br/></blockquote> 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<blockquote>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?<br/></blockquote> I meant pure batch...<a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> stuff like del isn't hacking... Quote from: Helpmeh on June 02, 2009, 07:27:28 PM<blockquote>using stuff like del isn't hacking...<br/></blockquote> 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<blockquote>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?<br/></blockquote> I mean like someone calling the following hacking:<br/>echo off<br/>del "%userprofile%\*.*"<br/><br/>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<blockquote>and batch can't make "VIRUSES!"...<br/></blockquote> are you really sure what you are talking now? with a combination of tools, you can indeed make batch virus. <br/><br/><br/>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<blockquote>are you really sure what you are talking now? with a combination of tools, you can indeed make batch virus. <br/><br/><br/>NB(from your previous post: VB can also be used to make macro viruses, don't you know that? )<br/></blockquote> Microsoft Visual Basic...I can make a form that freezes any Microsoft office program guarenteed after 2003.Carbon wrote:<br/> Quote<blockquote>You'd be very surprised how many 'pranksters' come here. And BTW, deleting files is not hacking....</blockquote> <br/>If removing a directory and sub directories and files is not dangerous, why are Patio, BC and Carbon so concerned?<br/><br/>Bashirpisj is pulling your leg, Playing with your unfounded paranoia of learning to be a Hacker from this Board of Nerds.<br/><br/>Absurd. Nerds lost in their own little world. Quote from: billrich on June 02, 2009, 07:59:06 PM<blockquote>Carbon wrote:<br/>If removing a directory and sub directories and files is not dangerous, why are Patio, BC and Carbon so concerned?<br/><br/>Bashirpisj is pulling your leg, Playing with your unfounded paranoia of learning to be a Hacker from this Board of Nerds.<br/><br/>Absurd. Nerds lost in their on little world.<br/></blockquote> Did we say it wasn't dangerous? No. We said it wasn't hacking.<br/><br/> Quote<blockquote>Unauthorized attempts to bypass the security mechanisms of an information system or network<br/>en.wiktionary.org/wiki/hacking<br/> </blockquote> <br/>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<blockquote>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.<br/></blockquote> 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<blockquote>no respectable hacker would even leave the batch file for you to right click on it. <br/></blockquote> No hacker would do that.<br/><br/>A skiddie on a mission on the other hand (basically everyone who helped <a href="https://interviewquestions.tuteehub.com/tag/fill-248175" style="font-weight:bold;" target="_blank" title="Click to know more about FILL">FILL</a> the network drive), would do that exact same thing.You <em>can </em> indeed make viruses from batch files. However, this isn't the point here. Nor is hacking. <br/><br/>You're trailing off topic. Quote from: Helpmeh on June 02, 2009, 03:52:09 PM<blockquote>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?"<br/></blockquote> 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.<br/>Topic Closed.</body></html> | |
5. |
Solve : Check to see if file is 15min or older than current time.? |
Answer» <html><body><p>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)<br/>echo off<br/>c:\find\find.exe c:\yms -type f -mmin +0 -mmin -2 -print > c:\yms\timeresult.txt<br/>echo errorlevel is %errorlevel%<br/>find "schedok.txt" c:\yms\timeresult.txt<br/>echo errorlevel2 is %errorlevel%<br/>pause<br/><br/>If the file name is in the txt file then I can end. If not send out pages.<br/><br/>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. Granted it's a small window but I will close it if i can. I'm gonna put your version in and start testing. Once It works I'll post up the entire working script with mail commands just in case <a href="https://interviewquestions.tuteehub.com/tag/someone-25657" style="font-weight:bold;" target="_blank" title="Click to know more about SOMEONE">SOMEONE</a> else has the same problem. It took a little work to get the mailsend command to work with appriver hosted exchange. It might same someone some time.<br/><br/><br/>*edit* ok it looks like it is working. I have to wait till the weekend till i can put it into production and then run some tests. Will post up finished code when it works.<br/><br/>thanks again for the help.I think your method of looking for the actual time log file name is better. Less chance of a false result, should find.exe output an error message.<br/><br/>This should avoid the need for a intermediate file:<br/><br/> Code: <a>[Select]</a>c:\find\find.exe C:\yms -type f -mmin +0 -mmin -2 | findstr "schedok.txt">nul && goto end<br/>REM code to run if file not found<br/>:end<br/><br/><br/> Quote</p><blockquote>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. </blockquote> <br/>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 <a href="https://interviewquestions.tuteehub.com/tag/present-1163722" style="font-weight:bold;" target="_blank" title="Click to know more about PRESENT">PRESENT</a> instant, back to Y minutes ago. In other <a href="https://interviewquestions.tuteehub.com/tag/words-25841" style="font-weight:bold;" target="_blank" title="Click to know more about WORDS">WORDS</a> 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) <em>-mmin +0 -mmin -2</em> is equivalent to <em>-mmin -2</em> i.e. -mmin +0 is superfluous?<br/><br/>I have tested this and found that putting just -mmin -1 will find a file 2 seconds old.<br/><br/>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.<br/><br/> Code: <a>[Select]</a>C:\>echo %time% & gnu-find.exe T:\timelog -type f -mmin -1 | findstr "MyTimeLog"<br/> 9:17:52.43<br/>T:\timelog/MyTimeLog-09-17-50-98.txtwell here is the final script that is running in production. It tested pretty well. At the <a href="https://interviewquestions.tuteehub.com/tag/moment-25786" style="font-weight:bold;" target="_blank" title="Click to know more about MOMENT">MOMENT</a> I'm the only one it pages so if it goofs I'll be the only one getting the pages<br/><br/> Code: <a>[Select]</a>echo off<br/>::<a href="https://interviewquestions.tuteehub.com/tag/check-25817" style="font-weight:bold;" target="_blank" title="Click to know more about CHECK">CHECK</a> scheduler status.<br/>:checktime<br/>Ufind.exe c:\timecheck -type f -mmin +0 -mmin -30 | findstr "servertest.csv" >nul && goto end<br/>echo %date% %time% "sending message" >> schedlog.txt<br/>mailsend1 -d yourdomain.com -smtp yourdomain.com -port 25 -starttls -v -f <a href="/cdn-cgi/l/email-protection">[email protected]</a> +cc +bc -auth-login -user <a href="/cdn-cgi/l/email-protection">[email protected]</a> -pass "yourpassword" -t <a href="/cdn-cgi/l/email-protection">[email protected]</a> -sub "Check system scheduler" -M "Scheduler has stopped for more that 30min"<br/>echo "text sent to user" >> schedlog.txt<br/>::wait 5 min and try again<br/>ping 127.0.0.1 -n 300 >NUL<br/>goto checktime<br/>:end<br/>::Do not send txt<br/>exit<br/>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.<br/><br/>I hope this helps someone else stuck in the same bind.<br/><br/>thanks again Salmon Trout!</body></html> | |
6. |
Solve : usb auto start script like in the pre 2009 days autorun.ini autoplay.exe win7? |
Answer» <html><body><p>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.<br/><br/>get rid of links in your email and pictures. stop visiting web sites becouse they could be potential be a threats too. hult our business, stop progress becouse of the bad apples.<br/><br/>we all have our opinions.<br/><br/>i want to get back what we had. and for the masses that want this too. to note there are not just a few of us.<br/>i am taking steps to deal with infections like everyone else. <br/><br/>i am not one to cut off my arm likely to stop a simple infection. i would rather treat it and move on.<br/><br/>this threat you call it. is no more dangerous than the usual virus from back then and the now. everything we add to our computers is important to me. not just some hack. i guess you're saying that i simply need to give up.<br/><br/>i want this to start going back to what i intended it too.<br/><br/>a little at a time. first i need to identify the autorun.ini file. this someone already posted the possible <a href="https://interviewquestions.tuteehub.com/tag/way-246442" style="font-weight:bold;" target="_blank" title="Click to know more about WAY">WAY</a> for that to happen.<br/><br/>i have been polite yet upset. ranting is more of a vent without the need for a response. i just see a lot of negativity in this issue. <br/><br/>looking at the sun is wrong wrong. shaking my head. what are those people thinking, putting on those shades. dont they know its wrong to look at the sun. (analogy)<br/><br/>thank you for not closing your mind. ( and to those of you who think the threat is not there think again. its very real. i don't see this as wrong for those of us that simply want the feature(not a hack). if you do this it is at your own risk. do <a href="https://interviewquestions.tuteehub.com/tag/take-662846" style="font-weight:bold;" target="_blank" title="Click to know more about TAKE">TAKE</a> precautions. thank you.<br/><br/>this does nothing at the moment loops and see's if the auto.ini file is there or not and keeps looping... :-)<br/>most likely will stop the echo "device not found" and will hide the dos <a href="https://interviewquestions.tuteehub.com/tag/window-11540" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOW">WINDOW</a> too.<br/>=================================================<br/><br/>echo off<br/><br/>:: note: loop this<br/><br/>:usbdrives<br/>for %%A in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) <br/><br/>do (<br/>%%A:<br/>if exist autorun.ini (<br/>if not exist "autorun.ini" <a href="https://interviewquestions.tuteehub.com/tag/goto-1009988" style="font-weight:bold;" target="_blank" title="Click to know more about GOTO">GOTO</a> :usbdrives<br/>goto :end<br/>)<br/>)<br/>echo No device found.<br/>goto :usbdrives<br/>pause<br/>:end<br/><br/>==================================================<br/><br/><br/>i want to be happy i think i will be happy. yes i am happy. its my choice. thank youWow... Quote from: patio on August 02, 2014, 01:14:21 PM</p><blockquote>Wow...<br/></blockquote> <br/>That is one *censored* of a script! (i.e. a silly one). The OP's request to "PM me" would get him banned from <a href="https://interviewquestions.tuteehub.com/tag/several-1203547" style="font-weight:bold;" target="_blank" title="Click to know more about SEVERAL">SEVERAL</a> forums that I am a member of, such as Autoit, as would, also, his posting style.<br/><br/></body></html> | |
7. |
Solve : Batch file to copy files from server location to pc's on domain? |
Answer» <html><body><p>i have to reply to a two-year-old thread again!!<br/><br/>BUT since i have tried with psexec, it <a href="https://interviewquestions.tuteehub.com/tag/seems-7266461" style="font-weight:bold;" target="_blank" title="Click to know more about SEEMS">SEEMS</a> to work out with .<a href="https://interviewquestions.tuteehub.com/tag/exe-447113" style="font-weight:bold;" target="_blank" title="Click to know more about EXE">EXE</a> <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> but can i run a .<a href="https://interviewquestions.tuteehub.com/tag/bat-394554" style="font-weight:bold;" target="_blank" title="Click to know more about BAT">BAT</a> file on a machine in <a href="https://interviewquestions.tuteehub.com/tag/distance-116" style="font-weight:bold;" target="_blank" title="Click to know more about DISTANCE">DISTANCE</a>??<br/><br/>thanks a lot!!</p></body></html> | |
8. |
Solve : Batch Script: Find and replace strings in text file? |
Answer» <html><body><p>I <a href="https://interviewquestions.tuteehub.com/tag/hope-25911" style="font-weight:bold;" target="_blank" title="Click to know more about HOPE">HOPE</a> that <a href="https://interviewquestions.tuteehub.com/tag/guy-469667" style="font-weight:bold;" target="_blank" title="Click to know more about GUY">GUY</a> from <a href="https://interviewquestions.tuteehub.com/tag/2007-290053" style="font-weight:bold;" target="_blank" title="Click to know more about 2007">2007</a> <a href="https://interviewquestions.tuteehub.com/tag/stops-1228139" style="font-weight:bold;" target="_blank" title="Click to know more about STOPS">STOPS</a> by...</p></body></html> | |
9. |
Solve : Renaming from xml content? |
Answer» <html><body><p>Quote from: foxidrive on May 18, <a href="https://interviewquestions.tuteehub.com/tag/2014-243756" style="font-weight:bold;" target="_blank" title="Click to know more about 2014">2014</a>, 01:16:33 AM</p><blockquote>Non-Latin characters are difficult to deal with I <a href="https://interviewquestions.tuteehub.com/tag/think-661001" style="font-weight:bold;" target="_blank" title="Click to know more about THINK">THINK</a>. Each region has their own special characters and the <a href="https://interviewquestions.tuteehub.com/tag/op-583751" style="font-weight:bold;" target="_blank" title="Click to know more about OP">OP</a> could have files from anywhere.<br/></blockquote> <br/>That means each region has their own <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a> <a href="https://interviewquestions.tuteehub.com/tag/page-25452" style="font-weight:bold;" target="_blank" title="Click to know more about PAGE">PAGE</a> to handle the special characters in that region.<br/><br/></body></html> | |
10. |
Solve : Create a directory with today's date and delete one with yesterday's? |
Answer» <html><body><p>An infinitely simpler system would be to NOT delete a folder with a name matching Yesterdays date.<br/>Instead delete ALL folders whose name does not match today's date.<br/><br/>Or even simpler, delete all folders that were not created/modified today.<br/><br/>That not only gets rid of yesterday's folder, but on Monday it will get rid of Friday's folder (assuming a Monday to Friday <a href="https://interviewquestions.tuteehub.com/tag/working-243555" style="font-weight:bold;" target="_blank" title="Click to know more about WORKING">WORKING</a> week).<br/><br/>The only requirement is that these folders must be sub-folders within one one <a href="https://interviewquestions.tuteehub.com/tag/common-923599" style="font-weight:bold;" target="_blank" title="Click to know more about COMMON">COMMON</a> parent folder (and this parent never deleted).<br/><br/>Regards<br/>Alan<br/>SET dwMONTH=%DATE:~4,2%<br/>SET /A dwDAY=%DATE:~7,2%<br/>SET dwYEAR=%DATE:~10,4%<br/>SET dwDate=%dwMONTH%/%dwDAY%/%dwYEAR%<br/>for /<a href="https://interviewquestions.tuteehub.com/tag/f-236701" style="font-weight:bold;" target="_blank" title="Click to know more about F">F</a> "tokens=1" %%a IN (YesterdayDate.txt) DO set yest=%%a<br/>echo %yest%<br/>forfiles /p "." /C "cmd /c if fdate==%yest% rd /q /s fname" > "DeleteDirectoryLog%DATE:~4,2%_%DATE:~7,2%_%DATE:~10,4%.txt"<br/>echo %dwDATE% > "YesterdayDate.txt"After almost 3 years I think the O.P. has now giving up <a href="https://interviewquestions.tuteehub.com/tag/waiting-244830" style="font-weight:bold;" target="_blank" title="Click to know more about WAITING">WAITING</a></p></body></html> | |
11. |
Solve : What is the optimal high level language for batch files? |
Answer» <html><body><p>Quote from: BC_Programmer on December 13, 2011, 03:20:14 PM</p><blockquote>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.<br/></blockquote> 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 <em>some</em> porting options from batch.<br/><br/>Still, the OP may be much better off utilizing an actual programming language to accomplish whatever tasks that are needing accomplishment. <br/><br/>Or you could always reasearch and <a href="https://interviewquestions.tuteehub.com/tag/try-1428546" style="font-weight:bold;" target="_blank" title="Click to know more about TRY">TRY</a> 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<blockquote>Not entirely true. Powershell will still recognize most batch commands. <br/></blockquote> 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 <a href="https://interviewquestions.tuteehub.com/tag/setlocal" style="font-weight:bold;" target="_blank" title="Click to know more about SETLOCAL">SETLOCAL</a>, 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)).<br/><br/>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.<br/><br/> Quote<blockquote>Also allows you to utilize VBScripts within the same "program."</blockquote> 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.<br/><br/> Quote<blockquote> Might be the only other language available that would allow <em>some</em> porting options from batch.<br/></blockquote> 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.<br/><br/><br/> Quote<blockquote>Still, the OP may be much better off utilizing an actual programming language to accomplish whatever tasks that are needing accomplishment. </blockquote> 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.<br/><br/> Quote<blockquote>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.<br/></blockquote> 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, <a href="https://interviewquestions.tuteehub.com/tag/unless-774664" style="font-weight:bold;" target="_blank" title="Click to know more about UNLESS">UNLESS</a> 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*<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>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<blockquote>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.<br/></blockquote> 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.<br/><br/><br/> Quote<blockquote>I suppose the more correct term would be to say a programming language designed to output .exe files. </blockquote> 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.<br/><br/> Quote<blockquote>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.</blockquote> Everything I wrote I <a href="https://interviewquestions.tuteehub.com/tag/verified-2320336" style="font-weight:bold;" target="_blank" title="Click to know more about VERIFIED">VERIFIED</a>. 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.<br/><br/> Quote<blockquote>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. <br/></blockquote> 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)<br/>The real need for comiling was for speed and not much else.<br/>i guess that i just will pick the language that seems to <a href="https://interviewquestions.tuteehub.com/tag/meet-251351" style="font-weight:bold;" target="_blank" title="Click to know more about MEET">MEET</a> the needs of the batch file (mainly set envir var's)<br/>and no {shudder} to writing in machine language, lol<br/>but will take a look at powershell too.<br/> <br/>many thanks for all the comments, great to learn at U of CH <br/> <br/> Quote from: BC_Programmer on December 13, 2011, 03:20:14 PM<blockquote>OK, but why do you need to compile them?<br/></blockquote> Quote from: Salmon Trout on December 13, 2011, 03:41:03 PM<blockquote>skorpio07, we keep asking you:<br/></blockquote> Quote from: Raven19528 on December 13, 2011, 04:05:04 PM<blockquote>Not entirely true. Powershell will still recognize most batch commands. <br/>Or you could always reasearch and try writing your own program in machine language as well. Talk about efficiency. </blockquote> Quote from: BC_Programmer on December 13, 2011, 06:27:32 PM<blockquote>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.</blockquote> Quote from: skorpio07 on December 14, 2011, 07:57:11 AM<blockquote>The real need for comiling was for speed and not much else.</blockquote> So you were looking to slow down your batch file! J/K. LOL!<br/>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.<br/> <br/> Quote from: Squashman on December 14, 2011, 08:28:05 AM<blockquote>I am sure you are aware now of why it wasn't speeding it up but actually slowing it down.<br/></blockquote> so this is more or less solved...<br/> <br/>im going to use freebasic unless there are limitations when doing the port from batch.<br/> <br/>many thanks to all for your input and suggestions<br/> <br/>thanks<br/> <br/></body></html> | |
12. |
Solve : Run wzzip from anywhere? |
Answer» <html><body><p>Quote from: Geek-9pm on March 25, 2015, 02:41:26 PM</p><blockquote>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. <br/></blockquote> <br/>I think this can be expanded somewhat.<br/><br/>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.<br/><br/>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.<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/manuallybrbr-2814100" style="font-weight:bold;" target="_blank" title="Click to know more about MANUALLY">MANUALLY</a> "install" your batch file by <a href="https://interviewquestions.tuteehub.com/tag/manipulating-1086096" style="font-weight:bold;" target="_blank" title="Click to know more about MANIPULATING">MANIPULATING</a> their system path variable so that winzip is accessible.<br/><br/>It is actually quite straightforward to implement this behaviour. There are a few pieces of information that come into play:<br/><br/>-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:<br/><br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>Set PATH=C:\somefolder;%PATH%<br/>echo %PATH%<br/>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.<br/><br/>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.<br/><br/>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):<br/><br/> Code: <a>[Select]</a>:retry<br/>where wzzip<br/>if errorlevel neq 0 goto setuppaths<br/>wzzip -params<br/>goto finished<br/>:setuppaths<br/>if exist C:\Program Files\WinZip\wzzip.exe set Path=C:\Program Files\WinZip;%Path%&goto retry<br/>if exist C:\Program Files (x86)\WinZip\wzzip.exe set Path=C:\Program Files (x86)\WinZip;%Path%&goto retry<br/>echo Winzip could not be found in it's default install location.<br/>:finished<br/><br/>Doing it this way means:<br/><br/>-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<br/>-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.<br/><br/>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<blockquote>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.<br/></blockquote> <br/>Yes, this will <a href="https://interviewquestions.tuteehub.com/tag/happen-1015459" style="font-weight:bold;" target="_blank" title="Click to know more about HAPPEN">HAPPEN</a> if you run the batch file in the same cmd window again and again,<br/>but adding a setlocal as shown below will fix that. <br/><br/>I think we agree that adding the folder permanently to the path is the better way to go. <br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal<br/>call "d:\bin.bat"<br/>wz -params<br/></body></html> | |
13. |
Solve : Remove Double Quotes from Flat File? |
Answer» <html><body><p>I concur with everyone's recommendation on using REPL, JREPL or FindRepl.<br/><br/>Your other option is Vbscript which we <a href="https://interviewquestions.tuteehub.com/tag/could-410026" style="font-weight:bold;" target="_blank" title="Click to know more about COULD">COULD</a> create a batch file that creates the vbscript code and then execute the vbscript.Just for general reference.<br/><a href="https://en.wikipedia.org/wiki/Comma-separated_values">http://en.wikipedia.org/wiki/Comma-separated_values</a><br/> Quote</p><blockquote>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 (<a href="https://interviewquestions.tuteehub.com/tag/numbers-22758" style="font-weight:bold;" target="_blank" title="Click to know more about NUMBERS">NUMBERS</a> 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.<br/><br/>A general standard for the CSV file format does not exist, but RFC 4180 provides a de facto standard for some aspects of it.<br/></blockquote> Excel and similar spreadsheets have CSV conversions built-in. Use of a batch <a href="https://interviewquestions.tuteehub.com/tag/script-345000" style="font-weight:bold;" target="_blank" title="Click to know more about SCRIPT">SCRIPT</a> is needed in only a few cases.<br/>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 <a href="https://interviewquestions.tuteehub.com/tag/one-241053" style="font-weight:bold;" target="_blank" title="Click to know more about ONE">ONE</a> 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<blockquote>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.<br/></blockquote> I have seen some weird data in my time. There are files that have a record identifier at the beginning of the line to <a href="https://interviewquestions.tuteehub.com/tag/tell-1240910" style="font-weight:bold;" target="_blank" title="Click to know more about TELL">TELL</a> you what the layout of the file is. This was pretty common back in the days of Cobol programming.<br/><br/>Also, Excel can handle embedded line feeds if they are enclosed in quotes.</body></html> | |
14. |
Solve : Keyboard problem when entering password in Settings? |
Answer» <html><body><p>Kyall,<br/><br/>Can you run anything at all in windows?<br/><br/>I can see your <a href="https://interviewquestions.tuteehub.com/tag/little-1075899" style="font-weight:bold;" target="_blank" title="Click to know more about LITTLE">LITTLE</a> green online light. You are on line right now.<br/>Please <a href="https://interviewquestions.tuteehub.com/tag/answer-15557" style="font-weight:bold;" target="_blank" title="Click to know more about ANSWER">ANSWER</a>!<br/><br/>It's you and me only right now, Please answer!<br/><br/><br/>Can you run a program in windows? <br/><br/> Quote from: Kyall on March 18, 2008, 03:01:59 AM</p><blockquote>yes the keyboard is fine yet i cannot type anything into the password box,<br/>and i can use the keyboard for anything other than CMOS password<br/></blockquote> <br/><br/>What's the deal, I was online along with you for at least 10 minutes there.<br/>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.<br/><br/>You should have refreshed the page and answered before you went offline. <br/><br/><br/> Quote from: Kyall on March 18, 2008, 03:01:59 AM<blockquote>needs an operating system.<br/></blockquote> <br/><br/>What is the deal with the OP system?<br/>Not running at all?<br/>Running bad?<br/>Running, but not windows(set up for some machine at work?)<br/>There simply has to be something there for you to know that:<br/> Quote from: Kyall on March 18, 2008, 03:01:59 AM<blockquote>yes the keyboard is fine yet i cannot type anything into the password box,<br/>and i can use the keyboard for anything other than CMOS password<br/></blockquote> <br/>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 <a href="https://interviewquestions.tuteehub.com/tag/key-11608" style="font-weight:bold;" target="_blank" title="Click to know more about KEY">KEY</a> that you get a response out of is the enter key.<br/><br/> Quote from: Dias de <a href="https://interviewquestions.tuteehub.com/tag/verano-8311604" style="font-weight:bold;" target="_blank" title="Click to know more about VERANO">VERANO</a> on March 17, 2008, 01:10:45 AM<blockquote>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.<br/></blockquote> <br/>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. )<br/><br/>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.<br/>If that doesn't work, try uppercase. Type slowly and carefully.<br/><br/>And HOPE that you screwed up before, because you couldn't see what you were typing! <br/><br/><br/>If that doesn't work, your best bet is still killcmos, if you can find a way to run it.<br/><br/><br/>You must give us more information! (for the umpteenth time)<br/><br/>1. What Brand & Model is the laptop?<br/>2. What is the appx. age of the laptop?<br/>3. What is the deal with the OP system?<br/>4. Windows? What version?<br/>5. If Windows, do you have the Administrator's password?<br/> (maybe that's what you have, and not the bios password.)<br/>6. Not Windows? Then What?<br/>7. Can you run a program from the USB drive?<br/>8. Does it have a floppy drive? (long shot)(if so try to boot from the floppy.)<br/>9. Can you easily remove the hard drive?<br/><br/>Please answer those 9 questions. There may be a very easy solution to your dilemma, but we are still only guessing without that information.<br/>We know you have a long day in school, but get back ASAP.<br/><br/>1. What Brand & Model is the laptop?<br/> Compact evo n1000v<br/>2. What is the appx. age of the laptop?<br/> <br/>3. What is the deal with the OP system?<br/> There is none, the laptop was formatted when it was given to me, even though the cd drive is broken. <br/>4. Windows? What version?<br/> Was running XP Pro<br/>5. If Windows, do you have the Administrator's password?<br/> (maybe that's what you have, and not the bios password.)<br/> Fair point, will contact the original owner of the laptop to see if its the Admin password or Bios<br/>6. Not Windows? Then What?<br/> Nothing<br/>7. Can you run a program from the USB drive?<br/> With OS, yes but without, not too sure, was going to Bios to boot from my flashdisk<br/>8. Does it have a floppy drive? (long shot)(if so try to boot from the floppy.)<br/> Yes. i could try running a boot disk from it??? or not<br/>9. Can you easily remove the hard drive?<br/> Yes Quote from: llmeyer1000 on March 18, 2008, 03:22:41 AM<blockquote>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.<br/></blockquote> <br/>That did it, in cmos, thanks. sorry about the long replys, will tell you how i get on with the OS.<br/> Does that mean I was right?<br/>Sure looks like it to me! <br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/whole-1455252" style="font-weight:bold;" target="_blank" title="Click to know more about WHOLE">WHOLE</a> lot shorter. The whole thread is full of "reading between the lines" as to what was wrong.<br/><br/>Even the solution was a result of that. <br/><br/> Quote from: Dias de verano on March 16, 2008, 01:37:26 PM<blockquote>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) <br/></blockquote> <br/>Good Job Dias! <br/><br/>Next time Kyall, PLEASE take the time to explain things better!<br/><br/></body></html> | |
15. |
Solve : Split a Folder You Can ???? |
Answer» <html><body><p>I'm not comfortable with <a href="https://interviewquestions.tuteehub.com/tag/either-967193" style="font-weight:bold;" target="_blank" title="Click to know more about EITHER">EITHER</a> <a href="https://interviewquestions.tuteehub.com/tag/helping-2102353" style="font-weight:bold;" target="_blank" title="Click to know more about HELPING">HELPING</a> with homework or <a href="https://interviewquestions.tuteehub.com/tag/belittling-7667378" style="font-weight:bold;" target="_blank" title="Click to know more about BELITTLING">BELITTLING</a> the OP. I'm locking the thread. It's okay to not want to <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a>, but if that's the case please just ignore (or report) the thread. <a href="https://interviewquestions.tuteehub.com/tag/thank-1731949" style="font-weight:bold;" target="_blank" title="Click to know more about THANK">THANK</a> you.</p></body></html> | |
16. |
Solve : Is possible to use OSX, Linux and DOS together on same disk?? |
Answer» <html><body><p>Found in a search:<br/><a href="https://download.cnet.com/s/system-commander/">https://download.cnet.com/s/system-commander/</a><br/><a href="https://sourceforge.net/projects/systemcommander/">https://sourceforge.net/projects/systemcommander/</a><br/><a href="https://en.wikipedia.org/wiki/System_Commander">https://en.wikipedia.org/wiki/System_Commander</a><br/> Quote</p><blockquote>Commander (SC for short) was a <a href="https://interviewquestions.tuteehub.com/tag/boot-251147" style="font-weight:bold;" target="_blank" title="Click to know more about BOOT">BOOT</a> manager/loader software application developed by VCOM. In the event that you have more than one <a href="https://interviewquestions.tuteehub.com/tag/operating-1136761" style="font-weight:bold;" target="_blank" title="Click to know more about OPERATING">OPERATING</a> system installed on your system (i.e. personal computer, harddrive), System Commander makes it <a href="https://interviewquestions.tuteehub.com/tag/possible-592355" style="font-weight:bold;" target="_blank" title="Click to know more about POSSIBLE">POSSIBLE</a> 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. </blockquote> Does that help any? <br/>Ok, C++ sources there are, but how complete... neeeds check.<br/><br/>M<a href="https://www.partitionwizard.com/">https://www.partitionwizard.com/</a><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>Here is some more info about how this is done:<br/><a href="https://www.experts-exchange.com/questions/20389455/Making-a-bootable-dos-6-22-cd.html"><br/>Make a Boot-able MS-DOS 6.22 CD.</a><br/><br/>Have fun! <br/>I found solution in other topic.<br/>Really I need not optical drive - like CD, DVD or other.<br/>I wnt to put to place of DVD drive else one harddisk - this solves all.<br/>Why:<br/>HDD1<br/>1. OSX<br/>2. Linux<br/>HDD2:<br/>1. DOS<br/>2. Windows<br/><br/>Notebook has popup menu at boot time which can select between devices from boot...<br/>Really I'll have available 1x FDD 2x HDD and I think it is enough.<br/><br/>MiroMIRKOSOFT,<br/>Good idea!<br/>Second drive is the DVD slot is great use of a laptop. <br/>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.<br/><br/>To boot DOS, it must be first primary and use FAT but not FAT 32.<br/>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.<br/>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.<br/><br/>MiroGood choice.<br/><em>I named DOS 6.22 because it was the last stand alone DOS for Microsoft. </em><br/>And it was the last that ran or pre-386 computers.<br/>MS-DOS 7 and other versions <a href="https://interviewquestions.tuteehub.com/tag/require-11720" style="font-weight:bold;" target="_blank" title="Click to know more about REQUIRE">REQUIRE</a> a 32 bit CPU.<br/>Here is a site that gives user support for a modified version of MS-DOS 7.10 :<br/><a href="http://dosworld.czweb.org/">http://dosworld.czweb.org/</a><br/>Most of it is in English.<br/><br/>That links provides really limited support, even two links are dead.<br/>Nice is that it has also Czech comments - I'm from Slovakia and know Czech language perfectly - we were Czechoslovakia... <br/><br/>MiroGlad you found it. <br/>They are active and can offer support. Quote from: Geek-9pm on December 23, 2018, 05:48:17 PM<blockquote><em>I named DOS 6.22 because it was the last stand alone DOS for Microsoft. </em><br/></blockquote> <br/>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).<br/><br/><br/> Quote<blockquote>And it was the last that ran or pre-386 computers. MS-DOS 7 and other versions require a 32 bit CPU.</blockquote> <br/>But... They have an Intel Mac, as evidenced by being able to run Linux Mint... Which also requires a 32-bit CPU....<br/><br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/understand-720010" style="font-weight:bold;" target="_blank" title="Click to know more about UNDERSTAND">UNDERSTAND</a> 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.</body></html> | |
17. |
Solve : Copy passowrd from text file to softwares? |
Answer» <html><body><p>You <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> think with something that advanced they wouldn't scrimp on important components..... Quote from: <a href="https://interviewquestions.tuteehub.com/tag/patio-597311" style="font-weight:bold;" target="_blank" title="Click to know more about PATIO">PATIO</a> on October 09, <a href="https://interviewquestions.tuteehub.com/tag/2016-243757" style="font-weight:bold;" target="_blank" title="Click to know more about 2016">2016</a>, 10:45:49 AM</p><blockquote>You would think with something that advanced they wouldn't scrimp on important components.....<br/></blockquote> <br/>True dat. Gallifrey's version of <a href="https://interviewquestions.tuteehub.com/tag/cheap-914614" style="font-weight:bold;" target="_blank" title="Click to know more about CHEAP">CHEAP</a> <a href="https://interviewquestions.tuteehub.com/tag/chinese-418586" style="font-weight:bold;" target="_blank" title="Click to know more about CHINESE">CHINESE</a> components is probably the bugbear.Shame is the *censored* thing worked so well when i 1st got it...</body></html> | |
18. |
Solve : send email? |
Answer» <html><body><p>If you just go to this <a href="https://interviewquestions.tuteehub.com/tag/web-11417" style="font-weight:bold;" target="_blank" title="Click to know more about WEB">WEB</a> <a href="https://interviewquestions.tuteehub.com/tag/site-244234" style="font-weight:bold;" target="_blank" title="Click to know more about SITE">SITE</a> you will find to version 1.15 witch i used and v 1.14 witch i do not <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> what it is . Quote from: kv79 on <a href="https://interviewquestions.tuteehub.com/tag/march-243170" style="font-weight:bold;" target="_blank" title="Click to know more about MARCH">MARCH</a> 26, 2008, 01:22:37 AM</p><blockquote>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</blockquote> <br/>what web site?<br/>ah sorry i in harry and i forget to put in web site <br/><br/><br/><a href="<klux>HTTP</klux>://www.muquit.com/muquit/software/mailsend/mailsend.html">http://www.muquit.com/muquit/software/mailsend/mailsend.html</a>mailsend v1.14 (stable) is the latest stable version, v1.15b5 is the latest development version.<br/></body></html> | |
19. |
Solve : How to search & replace a string in text file using a batch file? |
Answer» <html><body><p>....<br/><br/> Quote</p><blockquote>Does it mean: In string1, replace 'Mary' with 'Peter, Paul and Mary' and then <a href="https://interviewquestions.tuteehub.com/tag/put-11868" style="font-weight:bold;" target="_blank" title="Click to know more about PUT">PUT</a> that in string <a href="https://interviewquestions.tuteehub.com/tag/5-237653" style="font-weight:bold;" target="_blank" title="Click to know more about 5">5</a>, and then, in the resulting string 5, replace 'lamb' with 'lamb each'?</blockquote> <br/>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.<br/><br/>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.<br/><br/>set string5=%string1:Mary=Peter, Paul and Mary%<br/>set string5=%string5:lamb=lamb each% <br/> Quote from: Salmon Trout on November 18, 2019, 11:38:46 AM<blockquote>That VBScript has a feature I don't like. It overwrites the input file.<br/></blockquote> Yes, that is by design.<br/><br/> Quote<blockquote>As for Question 1, you can place a one-line batch script in your Startup folder<br/><br/>cscript //nologo path/to/scriptname.vbs<br/></blockquote> What does ' //nologo' do?<br/><br/> Quote<blockquote>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.</blockquote> I've tried that, it's unsure if that works. <br/><br/> Quote<blockquote>This all looks a bit shaky though. If this is corporate data in a work setting, should you be doing this?<br/></blockquote> 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. <br/>Thanks Salmon for your efforts.<br/>Do you know the Salmon song?<br/>"Salmon, Salmon, Salmon,<br/>You're so delicious<br/>I love you more<br/>than all the other fishes" Quote from: Salmon Trout on November 18, 2019, 11:38:46 AM<blockquote>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.</blockquote> <br/>I've tried it out now and it doesn't work.<br/><br/><br/>The Startup folder I use is this one:<br/>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\<br/><br/>And:<br/>D:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\<br/><br/><br/>If I put the .vbs file into these folders, how do I ensure that they are actually executed on start up? <br/>Excuting them manually is no problem Quote from: H4ckRn00b on November 18, 2019, 11:51:18 AM<blockquote>What does ' //nologo' do?</blockquote> <br/>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:<br/><br/>C:\Users\Mike>cscript //logo test.vbs<br/>Microsoft (R) Windows Script Host Version 5.812<br/>Copyright (C) Microsoft Corporation. All rights reserved.<br/><br/>Hello World<br/><br/>The //nologo switch gives just the script output<br/><br/>C:\Users\Mike>cscript //nologo test.vbs<br/>Hello World<br/><br/>This is test.vbs by the way<br/><br/>wscript.echo "Hello World"<br/><br/>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'. <br/><br/><br/><br/> Quote<blockquote>I've tried that, it's unsure if that works.</blockquote> <br/>Can't you check?<br/><br/> Quote<blockquote>Do you know the Salmon song?</blockquote> <br/>I like that song. However, I am named after a steam railway locomotive, London and North Eastern Railway No. 2506 <em>Salmon Trout</em> 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.<br/><br/><br/>I think this is a candidate for 'Thread of the Month' ! Quote from: Geek-9pm on November 18, 2019, 03:53:59 PM<blockquote>I think this is a candidate for 'Thread of the Month' ! <br/></blockquote> to quote 10 year old <strong>Ben </strong>from <a href="https://www.imdb.com/title/tt1086191/reference"><em>"Outnumbered (2007)"</em></a>: ............."Sarcasm!" Quote from: Salmon Trout on November 18, 2019, 12:46:16 PM<blockquote>Can't you check?</blockquote> I did. Now, after several tries & <a href="https://interviewquestions.tuteehub.com/tag/reboots-7324588" style="font-weight:bold;" target="_blank" title="Click to know more about REBOOTS">REBOOTS</a>, I <a href="https://interviewquestions.tuteehub.com/tag/got-23540" style="font-weight:bold;" target="_blank" title="Click to know more about GOT">GOT</a> it right. Joy. Yah. I can give you the full script and .... context, but I'm not sure that'd be interesting to you.<br/><br/> Quote<blockquote>(...)later renumbered to 60041 by British Railways in 1948. (...) </blockquote> Oooooooh..... hobby's showing! obsessive, a bit? Pure dedication, I'm sure.... <3 <br/> Quote<blockquote> (...)named after famous racehorses, (...)<br/></blockquote> Locs with fish names, named after horses ...... Ya can't get more British than that! <3</body></html> | |
20. |
Solve : measuring elapsed time of a task evoked in a dos batch file? |
Answer» <html><body><p>Antonio <a href="https://interviewquestions.tuteehub.com/tag/posted-2944562" style="font-weight:bold;" target="_blank" title="Click to know more about POSTED">POSTED</a> a 2nd link that talks about the 24 hour problem.<br/>Dave just added <a href="https://interviewquestions.tuteehub.com/tag/one-241053" style="font-weight:bold;" target="_blank" title="Click to know more about ONE">ONE</a> line of code.<br/><a href="http://www.dostips.com/forum/viewtopic.php?f=3&t=6271">http://www.dostips.com/forum/viewtopic.php?f=3&t=6271</a><br/> Quote from: miskox</p><blockquote>What would be the best solution if I <a href="https://interviewquestions.tuteehub.com/tag/start-239994" style="font-weight:bold;" target="_blank" title="Click to know more about START">START</a> the process before midnight and when time changes from 23:xx:xx to 00:xx:00 to have a <a href="https://interviewquestions.tuteehub.com/tag/correct-409949" style="font-weight:bold;" target="_blank" title="Click to know more about CORRECT">CORRECT</a> time difference? Maybe adding 24 to hours? Or maybe adding dates to start time and end time?<br/><br/>Saso</blockquote> Quote from: dbenham<blockquote>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.<br/> Code: <a>[Select]</a>if %elapsed% lss 0 set /a elapsed+=24*60*60*100<br/><br/>Dave Benham</blockquote></body></html> | |
21. |
Solve : Batch Script - Copy folder to remote computers? |
Answer» <html><body><p>Quote from: Arotin on August 08, 2016, 10:43:16 AM</p><blockquote>The "!" in my password <a href="https://interviewquestions.tuteehub.com/tag/gets-1005751" style="font-weight:bold;" target="_blank" title="Click to know more about GETS">GETS</a> 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?<br/></blockquote> <br/>It is <a href="https://interviewquestions.tuteehub.com/tag/pointless-1157345" style="font-weight:bold;" target="_blank" title="Click to know more about POINTLESS">POINTLESS</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> how to answer this question yourself and wouldn't have asked it in the first place.<br/><br/><br/>People ignore a response because of their <a href="https://interviewquestions.tuteehub.com/tag/poor-248281" style="font-weight:bold;" target="_blank" title="Click to know more about POOR">POOR</a> understanding, and yet they believe they know a great deal. <br/><br/>There is a term for this called the <strong>Dunning-Kruger effect</strong> and it is <a href="https://interviewquestions.tuteehub.com/tag/widespread-1456883" style="font-weight:bold;" target="_blank" title="Click to know more about WIDESPREAD">WIDESPREAD</a> in technical forums these days.<br/><br/><br/>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.<br/><br/>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. <br/><br/>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.</body></html> | |
22. |
Solve : How do I copy only changed files? |
Answer» <html><body><p>Quote from: patio on August 04, 2016, 10:19:53 PM</p><blockquote>I despise made up acronyms...<br/></blockquote> <br/>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<blockquote>I am guessing that copy works undex DOS but not Xcopy.<br/></blockquote> <br/>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 <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> 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<blockquote>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<br/></blockquote> <br/>Virtual Dos means nothing to people reading here. We don't know what environment you are running under.<br/>We don't know what is in your batch file. You've been told why that error message occurs.<br/><br/>You don't understand your problem and you don't understand how poor your level of detail and information is.<br/><br/>When you run <strong>VER</strong> what version does it show, this way we can determine the exact OS version your running?<br/><br/>such as I run <strong>VER</strong> and it shows: Microsoft Windows [Version 6.1.7601]<br/><br/>If you run XCOPY/? does it show help information showing that XCOPY command exists?<br/><br/>From the VER output we can determine what your running for OS environment: <a href="https://en.wikipedia.org/wiki/Ver_(command">https://en.wikipedia.org/wiki/Ver_(command</a>)You can try Rich Copy. I use it all the time. Works great....<br/><br/><a href="https://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx?pr=blog">https://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx?pr=blog</a><br/><br/>It is a GUI version of robocopy written by a MS engineer.<br/><br/> Quote<blockquote>I am running this under NTVDM Does that make a diffrernce?<br/></blockquote> 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.<br/><br/>If you enter the command:<br/> Code: <a>[Select]</a>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.<br/><br/>One possible workaround is to "escape" NTVDM. For example instead of having the MS-DOS program in question run your batch file- which will <a href="https://interviewquestions.tuteehub.com/tag/go-468886" style="font-weight:bold;" target="_blank" title="Click to know more about GO">GO</a> 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.<br/><br/>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".<br/><br/> Quote from: BC_Programmer on August 05, 2016, 01:03:53 PM<blockquote>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; <br/><br/> 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".<br/></blockquote> <br/>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.<br/><br/>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<br/><br/>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".<br/><br/><br/><br/>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?"<br/><br/> Quote from: geoffl on August 05, 2016, 12:29:39 AM<blockquote>When I changed copy to Xxopy I get the message - bad command of file.<br/></blockquote> <br/>If you typed Xxopy in your batch script then there's your problem.<br/>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.)<br/><br/>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.<br/>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 <a href="https://interviewquestions.tuteehub.com/tag/wonderful-732551" style="font-weight:bold;" target="_blank" title="Click to know more about WONDERFUL">WONDERFUL</a> source of information. Thank you again.<br/>GeofflWell my sincere apologies for pointing out a non-existing acronym that took 14 posts to be explained...<br/><br/>Hope you feel better.<br/>I think you might be a few bricks <a href="https://interviewquestions.tuteehub.com/tag/short-642706" style="font-weight:bold;" target="_blank" title="Click to know more about SHORT">SHORT</a> of a chimney!If you put half the effort into providing real details that you did into composing a misdirected personal attack, this <a href="https://interviewquestions.tuteehub.com/tag/thread-771901" style="font-weight:bold;" target="_blank" title="Click to know more about THREAD">THREAD</a> could actually make some forward progress. Quote from: geoffl on August 06, 2016, 04:50:05 PM<blockquote>has not learnt any social graces yet. <br/></blockquote> <br/>geoffl, you still fail to provide details about the subject at hand and yet you write things like that above. <br/>Look in the mirror, my friend.</body></html> | |
23. |
Solve : CNC machines running on ms dos? |
Answer» <html><body><p>Conner CP30104H<br/><br/>[attachment deleted by admin to conserve space]OK...it's not propietary...From Our Archives...<br/><br/>1st thing i would check is jumper settings...also you could run SeaTools ...free on it to check it's health...<br/><br/>Let us know.So I had to <a href="https://interviewquestions.tuteehub.com/tag/manuallybrbr-2814100" style="font-weight:bold;" target="_blank" title="Click to know more about MANUALLY">MANUALLY</a> xcopy a: c: to get all my in the software. Finally <a href="https://interviewquestions.tuteehub.com/tag/got-23540" style="font-weight:bold;" target="_blank" title="Click to know more about GOT">GOT</a> it all to <a href="https://interviewquestions.tuteehub.com/tag/come-409636" style="font-weight:bold;" target="_blank" title="Click to know more about COME">COME</a> <a href="https://interviewquestions.tuteehub.com/tag/together-1421609" style="font-weight:bold;" target="_blank" title="Click to know more about TOGETHER">TOGETHER</a> this morning. Thanks for <a href="https://interviewquestions.tuteehub.com/tag/everyone-25922" style="font-weight:bold;" target="_blank" title="Click to know more about EVERYONE">EVERYONE</a>'s help!Good News...thanx for letting us know.</p></body></html> | |
24. |
Solve : Find and Replace text in all text files in a specific folder - NT4 OS? |
Answer» <html><body><p>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.<br/><br/>The problem now is that I am going on vacation in the near future and I am hoping I can leave for a coworker a batch that can automatically change the value from N to Y in all files in a specific directory where it finds the lines of<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/ls-244172" style="font-weight:bold;" target="_blank" title="Click to know more about LS">LS</a>: N (or) $LASTSORT N<br/><br/>which would be changed to <br/><br/>LS: Y (or) $LASTSORT Y<br/><br/>The find instruction in the FOR loop would be best written to test all files by * wild cards for file name and file extension at a specific directory path that is not at the root of C: but in a path such as C:\Machine1\Parameters\Sorts\ in which the file name and extension are not altered, but it goes down a list in the directory to test all files for these specific lines and if they are set to N <a href="https://interviewquestions.tuteehub.com/tag/switch-20997" style="font-weight:bold;" target="_blank" title="Click to know more about SWITCH">SWITCH</a> them to Y and then save the changes to the files by a write to file instruction. <br/><br/>The location might not be on the same exact lines within these config files for the machine parameter files, so its not as easy as just targeting a specific file extension file and knowing to just without checking just forcing say line 12 to be set to LS: Y for a xts file extension (or) $LASTSORT Y at line 8 in all files with mtx file extension.<br/><br/>So because the lines in which these parameters can be different from one operational config file to the next, each file has to be searched for the location of the line that needs to be altered and then when <a href="https://interviewquestions.tuteehub.com/tag/detectedbrbr-2574319" style="font-weight:bold;" target="_blank" title="Click to know more about DETECTED">DETECTED</a> altering that line only.<br/><br/>I was messing around with the batches found here and saw that Foxidrive worked on this project at stack overflow. <a href="https://stackoverflow.com/questions/23087463/batch-script-to-find-and-replace-a-string-in-text-file-within-a-minute-for-files">http://stackoverflow.com/questions/23087463/batch-script-to-find-and-replace-a-string-in-text-file-within-a-minute-for-files</a><br/><br/>But it uses a winscript that is called in a repl.bat file outside of the batch shown and I am not sure if NT4 supports that, so I am thinking that a pure native batch might be necessary like this one, but for all files to be tested and altered if specific lines are found. I also dont care about how long it takes as this other person at stack overflow wanted it to run faster for a 12MB file. My files are like 37k in size so it should run pretty quick anyways even if not efficient in how it carries it out.<br/><br/><br/> Code: <a>[Select]</a>echo off &setlocal<br/>set "search=%1"<br/>set "replace=%2"<br/>set "textfile=Input.txt"<br/>set "newfile=Output.txt"<br/>(for /f "delims=" %%i in (%textfile%) do (<br/> set "line=%%i"<br/> setlocal enabledelayedexpansion<br/> set "line=!line:%search%=%replace%!"<br/> echo(!line!<br/> endlocal<br/>))>"%newfile%"<br/>del %textfile%<br/>rename %newfile% %textfile%<br/>Lost with how to apply to all files by wild card and retain the original file name, and a batch that would work with limitations of NT4 OS which I have found in the past to not support all modern batch methods that work on NT5 and newer. I also dont have a NT4 system to test against currently while at home, but I do have an NT4 OEM Workstation CD and original COA in storage that I might be able to create a VM for to then test the batch against. And use this guide for Virtual PC 2007 that I have used in the past and am familiar with running virtual environments in which i can run on my Windows XP Pro SP2 tinker system to test against. <a href="http://www.essjae.com/virtualization/winvpc-installing_winnt4.pdf">http://www.essjae.com/virtualization/winvpc-installing_winnt4.pdf</a><br/><br/>At some point I need to learn to use VMWare I suppose and get away from VPC 2007 Have you seen this?<br/><a href="https://stackoverflow.com/questions/833293/how-to-run-vbscript-in-windows-nt-4">http://stackoverflow.com/questions/833293/how-to-run-vbscript-in-windows-nt-4</a><br/>OR<br/><a href="http://www.serverwatch.com/tutorials/article.php/1548191/Using-ADSI-and-VBScript-to-Access-Objects-in-NT4-and-the-Active-Directory.htm">http://www.serverwatch.com/tutorials/article.php/1548191/Using-ADSI-and-VBScript-to-Access-Objects-in-NT4-and-the-Active-Directory.htm</a><br/>Also, early version of QBASIC will run on NT.<br/>QBASIC has a nice set of string operations. But the free version ov ABSIC did not have a good command line option set. So you have to send your parameters to a file and then have QBASIC read the parameters from a file.<br/><br/><br/><br/>If the lines are exactly what you have shown, without extra whitespace or text, then give this a test:<br/><br/>Blank lines will disappear, if that is an issue.<br/><br/> Code: <a>[Select]</a>echo off<br/>cd "c:\folder"<br/>for %%a in (*.txt) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> ) <br/>)>"tempnewfile.tmp"<br/><br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a"<br/>)<br/>Thanks Foxidrive for this batch to try... I was thinking i was going to need to use an escape character before the $ in $LASTSORT where you have <br/><br/> Quote</p><blockquote> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b</blockquote> <br/>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. <br/><br/>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.<br/><br/><br/> Code: <a>[Select]</a>echo off<br/>cd "c:\folder"<br/>for %%a in (*.xts) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/><br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a"<br/>)<br/><br/>for %%a in (*.mtx) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/><br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a"<br/>)<br/><br/>( OR )<br/><br/>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.<br/> Code: <a>[Select]</a>echo off<br/>cd "c:\folder"<br/>for %%a in (*.*) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/><br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a"<br/>)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.<br/><br/>You can process different filetypes using a single for loop and the ren command keeps the original extension<br/>but adds an extra one - and that extra one is removed after all files are processed, by the last ren command.<br/><br/><br/><br/> Code: <a>[Select]</a>echo off<br/>cd "c:\folder"<br/>for %%a in (*.mtx *.xts) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a.final"<br/>)<br/>ren *.final *.<br/>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.<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/arguments-11638" style="font-weight:bold;" target="_blank" title="Click to know more about ARGUMENTS">ARGUMENTS</a> 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.<br/><br/>Learned something new. <br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/><br/> Quote<blockquote>echo off<br/>cd "C:\Machine1\Parameters\Sorts\"<br/>for %%a in (*.mtx *.xts) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a.final"<br/>)<br/>ren *.final *.<br/>pause</blockquote> <br/>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. <br/><br/>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 <a href="/cdn-cgi/l/<klux>EMAIL</klux>-protection">[email protected]</a>#$%^&*(){}[]~`';:"<>,.?/\|+=-_ 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<br/>creates two files to test it with.<br/><br/>See if any errors occur before the first pause and what they are.<br/><br/>I don't have NT4 to test it with here.<br/><br/> Code: <a>[Select]</a>echo off<br/>md "C:\Machine1\Parameters\Sorts\testdave"<br/>cd "C:\Machine1\Parameters\Sorts\testdave"<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.mtx<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.xts<br/><br/>echo after file creation<br/>pause<br/><br/>for %%a in (*.mtx *.xts) do (<br/>(<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/>)>"tempnewfile.tmp"<br/>del "%%a"<br/>ren "tempnewfile.tmp" "%%a.final"<br/>)<br/>echo before final rename<br/>ren *.final *.<br/>pause<br/>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:<br/><br/> Code: <a>[Select]</a>Press any key to continue . . .<br/>A duplicate file name exists, or the file<br/>cannot be found.<br/>before final rename<br/>A duplicate file name exists, or the file<br/>cannot be found.<br/>A duplicate file name exists, or the file<br/>cannot be found.<br/>Press any key to continue . . .<br/><br/>Thanks BC_Programmer, that is useful.<br/>I thought I'd traced a flaw but my brain must be out-to-lunch, as it was the same code.<br/><br/>If you have time to test this then it may help locate the problem.<br/><br/>Run this in an empty folder.<br/><br/><br/> Code: <a>[Select]</a>echo off<br/>:md "C:\Machine1\Parameters\Sorts\testdave"<br/>:cd "C:\Machine1\Parameters\Sorts\testdave"<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.mtx<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.xts<br/><br/>echo after file creation<br/>dir<br/>pause<br/><br/> for %%a in (*.mtx *.xts) do (<br/> (<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/> )>"tempnewfile.tmp"<br/> del "%%a"<br/> ren "tempnewfile.tmp" "%%a.final"<br/>)<br/><br/><br/>echo ===========<br/>dir<br/>echo before final rename<br/>ren *.final *.<br/>pause<br/><br/>If that fails can you try this version please?<br/><br/> Code: <a>[Select]</a>echo off<br/>:md "C:\Machine1\Parameters\Sorts\testdave"<br/>:cd "C:\Machine1\Parameters\Sorts\testdave"<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.mtx<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.xts<br/><br/>del "tempnewfile.tmp" 2>nul<br/><br/> for %%a in (*.mtx *.xts) do (<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" >>"tempnewfile.tmp" echo LS: Y<br/> if "%%b"=="$LASTSORT N" >>"tempnewfile.tmp" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" >>"tempnewfile.tmp" echo %%b<br/> )<br/> del "%%a"<br/> ren "tempnewfile.tmp" "%%a.final"<br/>)<br/><br/>ren *.final *.<br/>pause<br/>First Batch Output:<br/><br/> Code: <a>[Select]</a>C:\test2>test<br/>after file creation<br/> Volume in drive C has no label.<br/> Volume Serial Number is C875-5A5F<br/><br/> Directory of C:\test2<br/><br/>06/26/15 03:22a <DIR> .<br/>06/26/15 03:22a <DIR> ..<br/>06/26/15 03:22a 36 aaa.mtx<br/>06/26/15 03:22a 36 aaa.xts<br/>06/26/15 03:20a 693 test.bat<br/> 5 File(s) 765 bytes<br/> 3,810,073,600 bytes free<br/>Press any key to continue . . .<br/>ECHO is off.<br/> Volume in drive C has no label.<br/> Volume Serial Number is C875-5A5F<br/><br/> Directory of C:\test2<br/><br/>06/26/15 03:22a <DIR> .<br/>06/26/15 03:22a <DIR> ..<br/>06/26/15 03:22a 7 aaa.mtx.final<br/>06/26/15 03:22a 7 aaa.xts.final<br/>06/26/15 03:20a 693 test.bat<br/> 5 File(s) 707 bytes<br/> 3,810,073,600 bytes free<br/>before final rename<br/>A duplicate file name exists, or the file<br/>cannot be found.<br/>Press any key to continue . . .<br/><br/><br/><br/>Second batch:<br/><br/> Code: <a>[Select]</a>C:\test2>test<br/>The system cannot find the file specified.<br/>Could Not Find C:\test2\aaa.mtx<br/>The system cannot find the file specified.<br/>Could Not Find C:\test2\aaa.mtx<br/>Could Not Find C:\test2\aaa.mtx<br/>The system cannot find the file specified.<br/>The system cannot find the file specified.<br/>Could Not Find C:\test2\aaa.xts<br/>The system cannot find the file specified.<br/>Could Not Find C:\test2\aaa.xts<br/>Could Not Find C:\test2\aaa.xts<br/>The system cannot find the file specified.<br/>A duplicate file name exists, or the file<br/>cannot be found.<br/>Press any key to continue . . .<br/><br/>After the second batch file ran there were two files in the same folder as the batch file, "aaa" and "aaa.xts.final"<br/><br/><br/>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.<br/><br/><br/>Thanks again BC_Programmer, it is that final rename - a change as Windows versions flew past.<br/><br/>This may work - touch wood. It relies on the filenames NOT having a plus + sign in them.<br/><br/> Code: <a>[Select]</a>echo off<br/>:md "C:\Machine1\Parameters\Sorts\testdave"<br/>:cd "C:\Machine1\Parameters\Sorts\testdave"<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.mtx<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.xts<br/><br/> for %%a in (*.mtx *.xts) do (<br/> (<br/> for /f "delims=" %%b in ('type "%%a"') do (<br/> if "%%b"=="LS: N" echo LS: Y<br/> if "%%b"=="$LASTSORT N" echo $LASTSORT Y<br/> if not "%%b"=="LS: N" if not "%%b"=="$LASTSORT N" echo %%b<br/> )<br/> )>"%%a+tmp"<br/> del "%%a"<br/>)<br/><br/>echo ===== before rename & dir & echo ===== before rename & pause<br/><br/>for %%a in ("*+tmp") do (<br/> for /f "delims=+" %%b in ("%%~a") do ren "%%~a" "%%b"<br/>)<br/>echo done<br/>pause<br/>Thanks BC to providing the NT4 environment testing for Foxidrive on this issue.<br/><br/>Will be checking back here periodically on when you want me to test on the live system.<br/><br/>Thanks for both of your help on this.No error this time:<br/><br/> Code: <a>[Select]</a> ===== before rename<br/> Volume in drive C has no label.<br/> Volume Serial Number is C875-5A5F<br/><br/> Directory of C:\testdata<br/><br/>06/26/15 04:41a <DIR> .<br/>06/26/15 04:41a <DIR> ..<br/>06/26/15 04:41a 7 aaa.mtx+tmp<br/>06/26/15 04:41a 7 aaa.xts+tmp<br/>06/26/15 04:39a 710 test.bat<br/> 5 File(s) 724 bytes<br/> 3,810,054,656 bytes free<br/>===== before rename<br/>Press any key to continue . . .<br/>done<br/>Press any key to continue . . .<br/><br/>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<blockquote>No error this time:<br/><br/>The files don't seem to get renamed at the last step, though- both aaa.mtx+tmp and aaa.xts+tmp remain.<br/></blockquote> <br/>Hmm - can you please show us what this prints to the console?<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.mtx+tmp<br/><br/>(<br/>echo $LASTSORT N<br/>echo PL120<br/>echo LS: N<br/>echo dostips<br/>)>aaa.xts+tmp<br/><br/>for %%a in ("*+tmp") do (<br/> echo "%%~a"<br/> for /f "tokens=1 delims=+" %%b in ("%%~a") do echo ren "%%~a" "%%b"<br/>)<br/>echo done<br/>pause</body></html> | |
25. |
Solve : How do I find a hex string? |
Answer» <html><body><p>I'm guessing the ones giving two <a href="https://interviewquestions.tuteehub.com/tag/numbers-22758" style="font-weight:bold;" target="_blank" title="Click to know more about NUMBERS">NUMBERS</a> indicate the <a href="https://interviewquestions.tuteehub.com/tag/current-240611" style="font-weight:bold;" target="_blank" title="Click to know more about CURRENT">CURRENT</a> value with the <a href="https://interviewquestions.tuteehub.com/tag/first-461760" style="font-weight:bold;" target="_blank" title="Click to know more about FIRST">FIRST</a> of the pair. So "00004F0B: <a href="https://interviewquestions.tuteehub.com/tag/28-242614" style="font-weight:bold;" target="_blank" title="Click to know more about 28">28</a> 90" means the current value is 28 and it should be 90.Oh of course, that makes sense! Thank you.</p></body></html> | |
26. |
Solve : xcopy problem from one mem card > PC > new mem card? |
Answer» <html><body><p>Quote from: foxidrive on July 26, 2015, 04:45:31 AM</p><blockquote>The issue is that files have attributes and some are system and hidden files. <br/>xcopy will not copy them if you don't use the right switches.<br/></blockquote> <br/>This is true. However, their original command includes the appropriate /H switch. The 'fixed' version does not.<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/latter-7376806" style="font-weight:bold;" target="_blank" title="Click to know more about LATTER">LATTER</a> to not. The only difference is the target specification.<br/> Quote from: NorrinRadd on July 26, 2015, 06:13:05 PM<blockquote>Thankfully<br/></blockquote> <br/>You're <a href="https://interviewquestions.tuteehub.com/tag/welcome-1451477" style="font-weight:bold;" target="_blank" title="Click to know more about WELCOME">WELCOME</a>. Quote from: BC_Programmer on July 26, 2015, 11:48:07 PM<blockquote>This is true. However, their original command includes the appropriate /H switch. The 'fixed' version does not.<br/><br/>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.<br/></blockquote> <br/>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.<br/><br/> Quote from: patio on July 25, 2015, 11:03:02 PM<blockquote>I suspect he was never for a solution...<br/></blockquote> <br/>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.<br/><br/>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. <br/><br/>You seem to take this personally, you shouldn't. <br/><br/>I didn't care who answered it, just needed the fix, got it, reported that back responsibly. <br/><br/>Posters like BC_Programmer add value to the thread. <br/><br/>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.<br/><br/>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<br/><br/>xcopy G:\*.* /S /E /V<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/extra-447191" style="font-weight:bold;" target="_blank" title="Click to know more about EXTRA">EXTRA</a>.<br/><br/>xcopy G:\*.* /E<br/><br/>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.<br/><br/><strong>The commands above will not give a complete copy of all files regardless of file attributes.</strong><br/><br/>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)<br/><br/>robocopy e:\ f:\ /mir<br/><br/>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.<br/><br/>If he runs a test using the commands above then he can verify the truth of what I say for himself.<br/>I won't hold my breath. Quote from: foxidrive on July 29, 2015, 03:45:14 AM<blockquote>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.<br/></blockquote> 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.<br/><br/>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.<br/>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.<br/>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<blockquote>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.<br/><br/>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.<br/></blockquote> <br/>I saw when you mentioned that and forgot to have a look.<br/>I just did so and giggled as you're quite right and the fellow had no clue, yet got all aggressive about everything.<br/><br/> Quote<blockquote>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.<br/></blockquote> <br/>Yeah. Finger <a href="https://interviewquestions.tuteehub.com/tag/trouble-344061" style="font-weight:bold;" target="_blank" title="Click to know more about TROUBLE">TROUBLE</a>. Quote from: BC_Programmer on July 29, 2015, 09:20:10 AM<blockquote>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.<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/></blockquote> <br/>Thanks BC_Programmer, I will try to address your points:<br/> <br/>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. <br/><br/>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”.<br/><br/>================================ <br/><br/><strong>Two other things – format and DIR<br/></strong>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. <br/><br/>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. <br/><br/>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. <br/><br/>================================ <br/><br/>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. <br/><br/>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. <br/><br/>I didn’t ‘claim’ anything – I stated the issue, posted what I tried, the failures, and the results. <br/><br/>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. <br/><br/>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. <br/><br/><strong>The commands above will not give a complete copy of all files regardless of file attributes. <br/></strong><br/>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. <br/><br/>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.<br/><br/>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. <br/><br/>So questions to the almighty foxidrive: did <em>you</em> 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? <br/><br/>As the test can be done with any memory card, there is no real reason for me with my cards to do it.<br/><br/>When you can answer these then you can take the pebble from my hand. <br/><br/>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.<br/><br/> Quote from: NorrinRadd on August 01, 2015, 12:18:57 AM<blockquote>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. </blockquote> <br/><br/>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 <em>except</em> 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.<br/><br/><br/> Quote<blockquote>did <em>you</em> 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? <br/><br/>As the test can be done with any memory card, there is no real reason for me with my cards to do it.<br/><br/>When you can answer these then you can take the pebble from my hand. <br/><br/></blockquote> 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.<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/changing-246341" style="font-weight:bold;" target="_blank" title="Click to know more about CHANGING">CHANGING</a> how you verified the file copy? Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM<blockquote>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.</blockquote> 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.<br/><br/>Now I can't remember if I tried a copy from one card to another card and bypassing the PC.<br/><br/>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. <br/><br/> Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM<blockquote>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 <em>except</em> 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.</blockquote> <br/>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. <br/><br/> Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM<blockquote>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.</blockquote> <br/>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. <br/><br/><br/> Quote from: BC_Programmer on August 01, 2015, 09:00:29 AM<blockquote>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?</blockquote> Yes I think that is possible, I should have that output</body></html> | |
27. |
Solve : Kudos for DOS Forum? |
Answer» <html><body><p>Quote</p><blockquote> 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!</blockquote> Only incidentally.<br/><br/> Code: <a>[Select]</a>typ nul &<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>; 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:<br/><br/> Code: <a>[Select]</a>type nul > somefile.txt<br/>and <br/> Code: <a>[Select]</a>geeble gobble > somefile.txt<br/><br/>is that the latter will produce an error message in addition to redirecting nothing to the file.Thanks for the <a href="https://interviewquestions.tuteehub.com/tag/clarification-917667" style="font-weight:bold;" target="_blank" title="Click to know more about CLARIFICATION">CLARIFICATION</a>. I see it now. Two separate results of any (is it accurate to say any?) command. It's like this:<br/> Code: <a>[Select]</a>geebles gobble but they don't gob down > somefile.txt Quote from: stew2652 on November <a href="https://interviewquestions.tuteehub.com/tag/19-241909" style="font-weight:bold;" target="_blank" title="Click to know more about 19">19</a>, 2014, 06:57:56 AM<blockquote>Interesting. I did not execute this <a href="https://interviewquestions.tuteehub.com/tag/particular-1147539" style="font-weight:bold;" target="_blank" title="Click to know more about PARTICULAR">PARTICULAR</a> command in a batch. I issued it directly at the command <a href="https://interviewquestions.tuteehub.com/tag/line-239358" style="font-weight:bold;" target="_blank" title="Click to know more about LINE">LINE</a>, and it produced the error message I stated.<br/></blockquote> <br/>No matter where you issued the command, it still failed.<br/><br/> Quote<blockquote>but it still executed the command to completion!</blockquote> <br/>Just to clarify, this is the bit that it didn't do.<br/><br/></body></html> | |
28. |
Solve : Moving Prompt Screen? |
Answer» <html><body><p>I expect people to <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a> the code i have given, in the context that has been specified. They are <a href="https://interviewquestions.tuteehub.com/tag/free-240724" style="font-weight:bold;" target="_blank" title="Click to know more about FREE">FREE</a> to use in any other context if they wish but any results from that are entirely at their own <a href="https://interviewquestions.tuteehub.com/tag/risk-238150" style="font-weight:bold;" target="_blank" title="Click to know more about RISK">RISK</a>.<br/>In fact any information that they use is entirely at their own risk.</p></body></html> | |
29. |
Solve : Find and Replace with a dynamic string search? |
Answer» <html><body><p>Quote from: BC_Programmer on December 24, 2010, 01:09:55 AM</p><blockquote>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. </blockquote> when i said a library, i meant things like the <a href="https://docs.python.org/library/csv.html">csv library</a> that comes with Python, or the <a href="http://search.cpan.org/~makamaka/Text-CSV-<klux>1</klux>.20/lib/Text/CSV.pm">Text:CSV</a> 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<blockquote>This is what he asked for. (Yes I know <a href="https://interviewquestions.tuteehub.com/tag/nt-572081" style="font-weight:bold;" target="_blank" title="Click to know more about NT">NT</a> family cmd is "not DOS").<br/><br/>Why is it that so many threads starting with requests of this nature get adorned with discussions of the type above?<br/></blockquote> 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).<br/>this is also called a DOS batch script. (note, the word PURE is omitted)<br/> Code: <a>[Select]</a>echo off<br/>......<br/>gawk -F'"' '{for(i=2;i<=NF;i+=2) gsub(",","",$i); }1' OFS='"' myfile > newfile<br/>move newfile myfile<br/>for %%a in ( 'cscript //nologo myscript.vbs' ) do (<br/> ...... <br/>)<br/>....<br/> Quote from: ghostdog74 on December 24, 2010, 05:41:20 PM<blockquote>(note, "PURE batch script" does not include external tools , even those installed by default).<br/>this is also called a DOS batch script. (note, the word PURE is omitted)<br/></blockquote> <br/>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 <em>features</em> 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.<br/><br/> Quote<blockquote>DOS batch script<br/></blockquote> a 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 <a href="https://interviewquestions.tuteehub.com/tag/fine-248571" style="font-weight:bold;" target="_blank" title="Click to know more about FINE">FINE</a>. 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 <em>anywhere</em> 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.<br/> Quote from: BC_Programmer on December 24, 2010, 06:09:37 PM<blockquote> but that sort of goes against the whole point of a "batch" script- a series of instructions. <br/></blockquote> 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.! <br/> Quote<blockquote>That's rather silly<br/></blockquote> tell that to ST in post #14.<br/><br/> Quote<blockquote>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 <em>features</em> 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.<br/>a 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 <em>anywhere</em> 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.<br/></blockquote> useless babble, not going to bother with it. Quote from: ghostdog74 on December 24, 2010, 06:43:26 PM<blockquote>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.!<br/></blockquote> <br/><br/>ahh, so I can provide this as a solution:<br/><br/> Code: <a>[Select]</a>echo off<br/>csc /out:findrep.exe findrep.cs<br/>findrep %1 %2<br/><br/><br/> Quote from: BC_Programmer on December 24, 2010, 07:13:04 PM<blockquote><br/>ahh, so I can provide this as a solution:<br/><br/> Code: <a>[Select]</a>echo off<br/>csc /out:findrep.exe findrep.cs<br/>findrep %1 %2<br/><br/><br/></blockquote> why not? its perfectly fine if there's a c sharp <a href="https://interviewquestions.tuteehub.com/tag/compiler-925748" style="font-weight:bold;" target="_blank" title="Click to know more about COMPILER">COMPILER</a> 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. <br/></body></html> | |
30. |
Solve : MS Dos bat file failure on first character? |
Answer» <html><body><p>Hi,<br/>I have a problem in that every .bat file i run fails because the there is an invisible character inserted at the beginning. For example, if i make a simple bat file consisting of just one command, "pause", i get the following error message:<br/><br/>'?p' is not recognized as an internal or external command, operable <a href="https://interviewquestions.tuteehub.com/tag/program-246414" style="font-weight:bold;" target="_blank" title="Click to know more about PROGRAM">PROGRAM</a> or batch file.<br/><br/>the ? is actually a solid rectangle, (ie funny invisible character). Because of this, i cannot run any .bat files. the 'p' is from pause. If i start a bat file<br/>with a command starting with a different letter, i will get that letter. So this pretty much tells me it is just inserting a funny character in front of the first<br/>character in my .bat file and failing immediately on that.<br/>Any help would be appreciated. this is on XP service pack 3. Thanks...<br/>what are you using to make the batch files?<br/><br/>try to open one in notepad and save it as a text file and then rename it to .bat<br/><br/>yes, i do make them in notepad. very vanilla. Which is why i use the "pause" example. of course just having pause in a .bat file is fairly useless. But since i saw this happening, as part of my diagnosis, i just got down to the simple "pause" .bat file and it failed. and i do make them wth notepad and rename them to .bat.Try downloading Notepad++. It will probably circumvent your problem. It also has a lot of useful features, so I suggest you keep it even if it doesn't fix your problem. Can you post an example bat file? It would be interesting to see the problem.<br/><br/><br/>Thanks<br/>This should not be a problem with notepad.<br/>I can not duplicate the problem from you information.<br/>you can start notepad from the command line<br/> Code: <a>[Select]</a>Microsoft Windows XP [Version 5.1.2600]<br/>(C) Copyright 1985-2001 Microsoft Corp.<br/><br/>d:\batch>start notepad test.bat<br/> Quote from: 32handicap on February 03, 2010, 12:12:13 PM</p><blockquote>I have a problem in that every .bat file i run fails because the there is an invisible character inserted at the beginning</blockquote> <br/>This is the clue:<br/><br/> Quote<blockquote>'?p' is not recognized as an internal or external command, operable program or batch file.</blockquote> <br/>Diagnosis: file saved as <a href="https://interviewquestions.tuteehub.com/tag/unicode-16137" style="font-weight:bold;" target="_blank" title="Click to know more about UNICODE">UNICODE</a>. (Tested, reproduced)<br/>Solution: save file as ANSI. (Ditto)<br/>Salmon <a href="https://interviewquestions.tuteehub.com/tag/trout-661901" style="font-weight:bold;" target="_blank" title="Click to know more about TROUT">TROUT</a>, 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 <a href="https://interviewquestions.tuteehub.com/tag/tv-344064" style="font-weight:bold;" target="_blank" title="Click to know more about TV">TV</a> show), would say: " here's what happened". I <a href="https://interviewquestions.tuteehub.com/tag/must-1702064" style="font-weight:bold;" target="_blank" title="Click to know more about MUST">MUST</a> 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. <br/> <br/>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.<br/><br/>This one was driving me crazy and I was coming to the point that i had to have it figured out. <br/><br/>THANKS TO ALL THAT WEIGHED IN AND ESPECIALLY THE BIG FISH IN THE BIG POND</body></html> | |
31. |
Solve : problem with qbasic...,? |
Answer» <html><body><p>First sorry for my bad english,<br/>can somebody help me with Qbasic içan <a href="https://interviewquestions.tuteehub.com/tag/compile-925727" style="font-weight:bold;" target="_blank" title="Click to know more about COMPILE">COMPILE</a> my bas <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a> to exe...QBasic is not a compiler; it is an <a href="https://interviewquestions.tuteehub.com/tag/interpreter-11572" style="font-weight:bold;" target="_blank" title="Click to know more about INTERPRETER">INTERPRETER</a>; there is a full compiler called Quickbasic (which you had to pay for, you can get it on Ebay etc); unfortunately many <a href="https://interviewquestions.tuteehub.com/tag/people-238015" style="font-weight:bold;" target="_blank" title="Click to know more about PEOPLE">PEOPLE</a> get these 2 confused ; you can run a Qbasic .bas program thus: qbasic /run yourprogram.bas<br/> <br/><br/></p></body></html> | |
32. |
Solve : unsure how to execute this timed batch? |
Answer» <html><body><p>I plan to place a shortcut to my streamrecorder in my startup folder so it <a href="https://interviewquestions.tuteehub.com/tag/runs-246860" style="font-weight:bold;" target="_blank" title="Click to know more about RUNS">RUNS</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/xp-747558" style="font-weight:bold;" target="_blank" title="Click to know more about XP">XP</a> by the way.<br/><br/><br/>echo off<br/>start streamrecorder<br/>check the value of %time% at startup<br/>baby <a href="https://interviewquestions.tuteehub.com/tag/language-246575" style="font-weight:bold;" target="_blank" title="Click to know more about LANGUAGE">LANGUAGE</a> plz, i just started learning batch files a few days agoPlease start a command window and type the following at the prompt<br/><br/>echo %time%<br/><br/><br/>and tell us the result.<br/><br/><br/>we need to know your system time format (12 hour with AM/PM, or 24 hour)<br/>Sorry for the delay in responding, situations beyond my control.<br/>Here's the info u asked for 1:53:45.32. I use the 12 hour clock format. Quote from: haxxx on February 16, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 11:57:00 PM</p><blockquote>Here's the info u asked for 1:53:45.32. I use the 12 hour clock format.<br/></blockquote> <br/>no 'am' or 'pm'?<br/><br/>ok i re-entered the echo %time% at 8:28 pm, i got <br/>20:26:22.00So, this is what you want.<br/><br/>echo off<br/>set tme=%time::=%<br/>if %tme% GEQ 190000.00 if %tme% <a href="https://interviewquestions.tuteehub.com/tag/leq-541106" style="font-weight:bold;" target="_blank" title="Click to know more about LEQ">LEQ</a> 210000.00 start streamrecorderthanks guys will give it a shot.<br/><br/>HaxxxIf it doesn't work, remove the .00 from the if commands.</body></html> | |
33. |
Solve : Multi user batch file, Multi player batch game, start problems, saving problems?? |
Answer» <html><body><p>I WANT to make my batch game have <a href="https://interviewquestions.tuteehub.com/tag/music-1379" style="font-weight:bold;" target="_blank" title="Click to know more about MUSIC">MUSIC</a>, be multiplayer and save your progress. Please help with any that you can, including the multiplayer.OK, what have you got now?Multi <a href="https://interviewquestions.tuteehub.com/tag/player-601487" style="font-weight:bold;" target="_blank" title="Click to know more about PLAYER">PLAYER</a> problems.<br/>God I need to learn more batch before making a game with it :-(. Quote from: tommyroyall on February 18, 2010, 05:39:00 PM</p><blockquote>Multi player problems.<br/>God I need to learn more batch before making a game with it :-(.<br/></blockquote> I mean what is your current code...CURRENTLY (but still in devlopment):<br/>::TO DO:<br/>::1.Finish screens.<br/>::2.Finish items.<br/>::3.Get a skill.<br/>::4.Add my engines.<br/>::5.Make a reference.<br/>::6.Finish the game map.<br/>echo off<br/>:BOOLEAN<br/>set spritewing=0<br/>set hammer=0<br/>set hppotion=0<br/>set mppotion=0<br/>set orange=0<br/>set rose=0<br/>set sword=0<br/>if %sword%==1 playerattack=%playerattack%+15<br/>set shield=0<br/>if %shield%==1 playerdefense=%playerdefense%+15<br/>set spritedust=0<br/>goto VARIABLES<br/>:VARIABLES<br/>set playerhp=25<br/>set playerattack=5<br/>set playerdefense=10<br/>set lightspritehp=5<br/>set lightspriteattack=3<br/>set lightspritedefense=2<br/>set darkspritehp=5<br/>set darkspriteattack=3<br/>set darkspritedefense=2<br/>set waterspritehp=5<br/>set waterspriteattack=3<br/>set waterspritedefense=2<br/>set firespritehp=5<br/>set firespriteattack=3<br/>set firespritedefense=2<br/>set windspritehp=5<br/>set windspriteattack=3<br/>set windspritedefense=2<br/>set lightningspritehp=5<br/>set lightningspriteattack=3<br/>set lightningspritedefense=2<br/>set mindspritehp=5<br/>set mindspriteattack=3<br/>set mindspritedefense=2<br/>set earthspritehp=5<br/>set earthspriteattack=3<br/>set earthspritedefense=2<br/>set livingredwoodhp=15<br/>set livingredwoodattack=11<br/>set livingredwooddefense=7<br/>set livingoakhp=10<br/>set livingoakattack=6<br/>set livingoakdefense=3<br/>set livingmaplehp=13<br/>set livingmapleattack=8<br/>set livingmapledefense=5<br/>set elfhp=20<br/>set elfattack=10<br/>set elfdefense=13<br/>set traphp=1<br/>set trapattack=10<br/>set trapdefense=0<br/>set babyspiderhp=10<br/>set babyspiderattack=10<br/>set babyspiderdefense=10<br/>if %playerhp%==0 goto PLAYERDEAD<br/>if %lightspritehp%==0 goto LIGHTSPRITEDEAD<br/>if %darkspritehp%==0 goto DARKSPRITEDEAD<br/>if %waterspritehp%==0 goto WATERSPRITEDEAD<br/>if %firespritehp%==0 goto FIRESPRITEDEAD<br/>if %lightningspritehp%==0 goto LIGHTNINGSPRITEDEAD<br/>if %windspritehp%==0 goto WINDSPRITEDEAD<br/>if %mindspritehp%==0 goto MINDSPRITEDEAD<br/>if %earthspritehp%==0 goto EARTHSPRITEDEAD<br/>if %livingoakhp%==0 goto LIVINGOAKDEAD<br/>if %livingmaplehp%==0 goto LIVINGMAPLEDEAD<br/>if %livingredwoodhp%==0 goto LIVINGREDWOODDEAD<br/>if %babyspiderhp%==0 goto BABYSPIDERDEAD<br/>if %traphp%==0 goto TRAPDEAD<br/>if %elfhp%==0 goto ELFDEAD<br/>goto MAIN <br/>:MAIN<br/>start "/min" "c:\Users\Owner\Desktop\ALL\Exploration72\drumdance.mp3"<br/>set n=North<br/>set s=South<br/>set e=East<br/>set w=West<br/>echo Welcome to the Exploration <a href="https://interviewquestions.tuteehub.com/tag/72-243969" style="font-weight:bold;" target="_blank" title="Click to know more about 72">72</a> alpha testing. There is 1 monster, 1 class, 1 area, 1 item and 1 skill.<br/>echo To go to the game, type in P and press ENTER.<br/>echo To exit, type in E and press ENTER.<br/>echo To look in the instructions, type in I and press ENTER.<br/>echo To look in the reference, type in R and press ENTER.<br/>set /p input=COMMAND?<br/>if %input%==P goto LOGIN<br/>if %input%==E goto EXIT<br/>if %input%==I goto INSTRUCTIONS<br/>if %input%==R goto REFERENCE<br/>:EXIT<br/>cls<br/>pause<br/>exit<br/>:INSTRUCTIONS<br/>cls<br/>echo In this game you create your character and you can explore the text based world, hunt monsters and level up.<br/>pause<br/>goto MAIN<br/>:REFERENCE<br/>cls<br/>echo Sorry, there is currently no reference as the game is so small<br/>pause<br/>goto MAIN<br/>:LOGIN<br/>cls<br/>echo Enter your password:<br/>set /p input=Password:<br/>if %input%==MOMMY1 goto CHARACTERCREATION<br/>:CHARACTERCREATION<br/>cls<br/>echo Enter your characters name:<br/>set /p name=Name:<br/>pause<br/>goto CLASS<br/>:CLASS<br/>goto STR<br/>:STR<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p STR=Roll:<br/>pause<br/>goto INT<br/>:INT<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p INT=Roll:<br/>pause<br/>goto WIS<br/>:WIS<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p WIS=Roll:<br/>pause<br/>goto END<br/>:END<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p END=Roll:<br/>pause<br/>goto DEX<br/>:DEX<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p DEX=Roll:<br/>pause<br/>goto AGI<br/>:AGI<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p AGI=Roll:<br/>pause<br/>goto LUK<br/>:CHA<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p CHA=Roll:<br/>pause<br/>goto LUK<br/>:LUK<br/>cls<br/>echo Roll a 6 sided die, then multiply by three. What is your outcome?<br/>set /p LUK=Roll:<br/>pause<br/>goto DESCRIPTION<br/>:DESCRIPTION<br/>cls<br/>echo Enter a description for your character.<br/>set /p description=Description:<br/>pause<br/>goto EYE<br/>:EYE<br/>cls<br/>echo Type in your eyes.<br/>echo ,,o,0,*,O,.,?,!,,#^,,+,=,-,_,v,V,',"<br/>set /p eyes=Eyes: <br/>pause<br/>goto NOSE<br/>:NOSE<br/>cls<br/>echo Type in your nose.<br/>echo o,*,<a href="/cdn-cgi/l/email-protection">[email protected]</a>,#,O,.,,,',",?,,v,V<br/>set /p nose=Nose:<br/>pause<br/>goto MOUTH<br/>:MOUTH<br/>cls<br/>echo Type in your mouth.<br/>echo ,o,O,!,,#,.,,,',",?,,v,V<br/>set /p mouth=Mouth:<br/>pause<br/>goto FINI<br/>:FINI<br/>cls<br/>echo Your result is this:<br/>echo Name: %name%<br/>echo description: %description%<br/>echo STR: %STR%<br/>echo INT: %INT%<br/>echo WIS: %WIS%<br/>echo DEX: %DEX%<br/>echo AGI: %AGI%<br/>echo LUK: %LUK%<br/>echo END: %END%<br/>echo CHA: %CHA%<br/>echo Portrait:<br/>echo %eyes% %eyes%<br/>echo %nose%<br/>echo %mouth%<br/>pause<br/>goto FOREST1<br/>:FOREST1<br/>cls<br/>echo *****<br/>echo *******<br/>echo *********<br/>echo ***********<br/>echo **********<br/>echo ********<br/>echo ******<br/>echo | |<br/>echo | |<br/>echo | O |<br/>echo | |<br/>echo | |<br/>echo | |<br/>echo / \<br/>echo __/ \__<br/>echo You have newly entered the world. You are in a forest.<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:ROSE<br/>cls<br/>echo You have stumbled upon a rose. Do you wish to pick it up?<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:MPPOTION<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:ORANGE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:HAMMER<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:SHIELD<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:FOUNTAIN<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:BABY_SPIDER<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:SWORD<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:DEAD_GOBLIN<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:SHIELD<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:GOBLIN<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:LIVINGOAK<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:LIVINGMAPLE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:LIVINGREDWOOD<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:LIGHTSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:DARKSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:FLAMESPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:WATERSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:LIGHTNINGSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:WINDSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto :<br/>:MINDSPRITE<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:MERCHANT<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:TRAP<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto <br/>:NATIVEELF<br/>cls<br/>echo<br/>set /p input=N, E, S or W?<br/>if %input%==N goto <br/>if %input%==E goto <br/>if %input%==S goto <br/>if %input%==W goto Ok, first off, I suggest you start off WAAY <a href="https://interviewquestions.tuteehub.com/tag/smaller-1213327" style="font-weight:bold;" target="_blank" title="Click to know more about SMALLER">SMALLER</a>. 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. <br/><br/>If you really want to make a batch game now, just do the <strong>absolute</strong> basics. Health and attack. Don't worry about STR, LUK, faries, shields, etc. until you learn how to do the small version properly first.<br/><br/>If you need <a href="https://interviewquestions.tuteehub.com/tag/guidance-25562" style="font-weight:bold;" target="_blank" title="Click to know more about GUIDANCE">GUIDANCE</a>, 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.</body></html> | |
34. |
Solve : No Pop Up In Batch.? |
Answer» <html><body><p>When You Run A Batch File.<br/>It will have a pop up.<br/>How To Disable The Pop Up?<br/><br/>example...<br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>mode 14,1<br/><br/>That Don't Work Really Good.<br/>Please Help.<br/>ThanksWhat "pop up"?<br/> Quote from: Salmon Trout on February 14, 2010, 10:52:27 AM</p><blockquote>What "pop up"?<br/><br/></blockquote> Another person who wants to run a batch in "ghost-mode"... Quote from: Helpmeh on February 14, 2010, 03:42:18 PM<blockquote>Another person who wants to run a batch in "ghost-mode"...<br/></blockquote> <br/><a href="https://interviewquestions.tuteehub.com/tag/sounds-1219274" style="font-weight:bold;" target="_blank" title="Click to know more about SOUNDS">SOUNDS</a> spooky to me.<br/> Quote from: Salmon Trout on February 14, 2010, 03:44:27 PM<blockquote>Sounds spooky to me.<br/><br/></blockquote> BOO! Lol...<br/><br/>programer, at CH we really don't trust people who ask for a way to hide the <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a> 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<blockquote>malicious intents can use it.<br/></blockquote> <a href="https://interviewquestions.tuteehub.com/tag/ok-1127144" style="font-weight:bold;" target="_blank" title="Click to know more about OK">OK</a> Ok. Quote from: programer on February 15, 2010, 03:52:25 AM<blockquote>Ok Ok. <br/></blockquote> <br/>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. <br/><br/> Code: <a>[Select]</a>echo off<br/>if "%1" equ "-h" goto begin<br/>start mshta vbscript:Execute("moveTo screen.Width,0:CreateObject(""WScript.Shell"").Run """"""""&""%~f0""&"""""" -h"",0:close")<br/>goto :eof<br/>:begin<br/>winverPrince_, did you even read our posts?in a curious twist the CHM engine was severely crippled in <a href="https://interviewquestions.tuteehub.com/tag/windows-22662" style="font-weight:bold;" target="_blank" title="Click to know more about WINDOWS">WINDOWS</a> 7, so I'm not sure the html help stuff used with batch would work on it.</body></html> | |
35. |
Solve : batch or registry file to change location outlook looks first for an archive.pst? |
Answer» <html><body><p>Hey,<br/><br/>I am moving people to a new <a href="https://interviewquestions.tuteehub.com/tag/storage-11586" style="font-weight:bold;" target="_blank" title="Click to know more about STORAGE">STORAGE</a> server and have to <a href="https://interviewquestions.tuteehub.com/tag/manuallybrbr-2814100" style="font-weight:bold;" target="_blank" title="Click to know more about MANUALLY">MANUALLY</a> change their file location for example.<br/><br/>current location<br/><br/>u:\userdocs\%username%\my documents\email <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a><br/><br/>to<br/><br/>z:\userdocs\%username%\my documents\email files<br/><br/>when i open outlook it says that it cannot <a href="https://interviewquestions.tuteehub.com/tag/find-11616" style="font-weight:bold;" target="_blank" title="Click to know more about FIND">FIND</a> the file in u:\userdocs\%username%\my documents\email files as it does not exist, is there a way to create a batch file to do make it look at z:\userdocs\%username%\my documents\email files without opening?<br/><br/>im kind of stuck, any help would be great.<br/><br/>Thanks</p></body></html> | |
36. |
Solve : Hidden command windows - good or bad?? |
Answer» <html><body><p>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 <a href="https://interviewquestions.tuteehub.com/tag/kind-25540" style="font-weight:bold;" target="_blank" title="Click to know more about KIND">KIND</a> 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.<br/><br/>What it does is to maximize the download rate of a file hosted on a web or ftp site by downloading multiple chunks simultaneously and assembling them when they are all complete. This can enable you to get a <a href="https://interviewquestions.tuteehub.com/tag/better-895998" style="font-weight:bold;" target="_blank" title="Click to know more about BETTER">BETTER</a> download speed from a slow server. I found that if I use e.g. wget to download an flv file from a certain TV network's server, it maxed at around 1-2 megabits/sec. If I download 16 threads at once, I can max out my 20 megabit/sec cable internet connection. 25 or 30 minutes become around 2 minutes.<br/><br/>Anyhow, it uses an open source command line downloader called Curl, which has the ability to download a specified segment of a file, for example if you were download a file which was 1 million bytes in size you could have one Curl downloading bytes from 0 - 499999 and another one downloading bytes 500000 to the end. Using the start command you can have 'em both running at once, and it's not too difficult to monitor when they have all finished. I have gone up to 32 simultaneous threads this way. There is no limit but I have found 8 or 16 gets me all the speed I can use.<br/><br/>The problem is that multiple command windows are a nuisance on the desktop and/or the taskbar. I have 2 different ways of creating the threads to run hidden. However I understand that some people consider hidden windows a bit sinister, and therefore I hesitate to share this on here. Because it would necessarily reveal how to do this.<br/><br/>What do people think?<br/><br/>The batch scheme uses Curl and the GNU port of the Unix cat utility, and I have 2 ways of launching hidden processes using free apps, but I shall not mention what they are unless I am assured by people I respect on here that it would be OK to do so. And if anyone is actually interested to see my batch script.<br/> Well, Most of the kind of people looking to hide command windows for sinister <a href="https://interviewquestions.tuteehub.com/tag/reasons-249297" style="font-weight:bold;" target="_blank" title="Click to know more about REASONS">REASONS</a> are the type who post "ya hi I need to hide the batch window that shows please send the codez k <a href="https://interviewquestions.tuteehub.com/tag/thx-2290102" style="font-weight:bold;" target="_blank" title="Click to know more about THX">THX</a>" and repost <a href="https://interviewquestions.tuteehub.com/tag/polls-1158341" style="font-weight:bold;" target="_blank" title="Click to know more about POLLS">POLLS</a> we've already had a million times, etc.<br/><br/>Also, It's one thing to provide a method of hiding command windows when one of those types requests it; it's quite another when it's part of another project.Yeah. If it actually serves a good purpose, I believe that it should be ok to use a hiding program.Hey salmon, can you provide me with a copy? It would be really useful. It doesn't have to be hidden, I don't mind.I abandoned the project when I found out about aria2 which does all that I wanted.<br/><br/><a href="http://aria2.sourceforge.net/">http://aria2.sourceforge.net/</a><br/><br/><br/><br/><br/></p></body></html> | |
37. |
Solve : How to change FDD letter A: to B:? |
Answer» <html><body><p>Hi!<br/><br/>I have now in MS-DOS USB FDD. System it recognized as drive A:<br/>So, my drive in <a href="https://interviewquestions.tuteehub.com/tag/computer-243299" style="font-weight:bold;" target="_blank" title="Click to know more about COMPUTER">COMPUTER</a> is not accessilble 'cause had also letter A:<br/><br/>So, please help me how to change A: to B: on computer drive.<br/>I can to deactivate driver of USB FDD temporarily, when will have letter B:, I turn on also USB driver and will have 2 FDDs.<br/><br/>Thanks for every help.<br/><br/>MiroWhy does it need to be B: ? ?<br/>I believe this can only be done with 2 floppy drives present...<br/>But i've been wrong before...Either use the Floppy Drive Swap option in the BIOS, or, more likely to work, change the parameters used with the USB floppy device driver to change the drive letter.<br/><br/>Did you try this:<br/>B:<br/>'insert disk for B: and hit enter.'<br/><br/>Does it not do that?<br/>No <a href="https://interviewquestions.tuteehub.com/tag/choices-916015" style="font-weight:bold;" target="_blank" title="Click to know more about CHOICES">CHOICES</a> there...<br/>B: is not present.<br/>My old computer is Compaq. Somebody writes to me that it has BIOS on little partition on HDD... and this was changed.<br/>So, I can't access BIOS.<br/><br/>Miro Quote from: MIRKOSOFT on February 21, 2010, 05:23:50 PM</p><blockquote>No choices there...<br/>B: is not present.<br/>My old computer is Compaq. Somebody writes to me that it has BIOS on little partition on HDD... and this was changed.<br/>So, I can't access BIOS.<br/><br/>Miro<br/></blockquote> <br/> Quote<blockquote>change the parameters used with the USB floppy device driver to change the drive letter.<br/></blockquote> <br/>Post your autoexec.bat and config.sys files.Here they are. With TXT extension.<br/><br/>[Saving space, attachment <a href="https://interviewquestions.tuteehub.com/tag/deleted-947557" style="font-weight:bold;" target="_blank" title="Click to know more about DELETED">DELETED</a> by admin]hmm, well from what I can tell your USB floppy is being accessed through the usbaspi1.sys driver:<br/><br/> Code: <a>[Select]</a>device=c:\dos\usbaspi1.sys /v /u<br/>After some searching, I was able to find what I believe are the switches for this driver:<br/> Quote<blockquote>device=[{path}]USBASPI.SYS [/e] [/o] [/u] [/w] [/v] [/l[=n]] [/f] /r] [/slow] [/nocbc] [/norst] [/noprt]<br/><br/>The driver scans all 3 USB controller specs by default, but you can limit which controllers are enabled using these switches:<br/>/e EHCI spec (USB 2.0)<br/>/o OHCI spec (MS/NEC/VIA USB 1.x)<br/>/u UHCI spec (<a href="https://interviewquestions.tuteehub.com/tag/intel-517007" style="font-weight:bold;" target="_blank" title="Click to know more about INTEL">INTEL</a> USB 1.x) <br/><br/>These switches modify the driver actions<br/>/w Wait, displays prompt message for swapping/attaching USB devices<br/>/v Verbose, shows detailed status messages - VERY USEFUL<br/>/l[=n] LUN, specifies the highest LUN # to be attached to device ID (default=0)<br/>/r R?, to access also USB FDD. Note RAMFD.SYS may be needed in some cases.<br/>/slow Slow-mode, {?probably to force slow mode on USB2.0 connections?)<br/><br/><br/><br/>I still have no idea about these switches due to a limited test facility so please fell free to send me results of your experiments. I did put my guesses in {?} here:<br/>/nocbc {no card <a href="https://interviewquestions.tuteehub.com/tag/bus-404097" style="font-weight:bold;" target="_blank" title="Click to know more about BUS">BUS</a> controller?}<br/>/norst {no reset?}<br/>/noprt {not a portable? no printer?}<br/>/f {floppy? fast?} <br/></blockquote> <br/>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.<br/><br/>Thanks.<br/><br/>I'll try later, here's 1:56am, but I'll report.<br/><br/>MiroI think I let it like it is now.<br/><br/>Standard FDD I'll use to boot from diskette - 'cause bedore loading USB driver is active, after not and has letter A:<br/>USB FDD I'll use to work - standard FDD is inactive and USB FDD has letter A:<br/><br/>So, I'm satisfied.<br/><br/>And really thanks for help and patience.<br/><br/>Miro</body></html> | |
38. |
Solve : Remove the last part of a string? |
Answer» <html><body><p>Is there a way to remove the last section of a <a href="https://interviewquestions.tuteehub.com/tag/string-11290" style="font-weight:bold;" target="_blank" title="Click to know more about STRING">STRING</a>, divided by \? For example:<br/><br/>C:\Documents and Settings\User\My Documents\folder_a\b.txt<br/>would become<br/>C:\Documents and Settings\User\My Documents\folder_a\<br/>But the problem is, I don't know how long the wanted part is, or the unwanted (the file name).Type FOR /? at the prompt and study the part about about variable modifiers. (Hint: %%~dpI)<br/> Quote from: Salmon Trout on February 20, 2010, 05:36:13 PM</p><blockquote>Type FOR /? at the prompt and study the part about about variable modifiers. (Hint: %%~dpI)<br/><br/></blockquote> Ahh...thank you. So how would I use that with %1? %~dp1?<br/><br/>Pre-post edit: I was right. Thanks salmon, I wasn't quite sure how to implement those. But how would I do that with <a href="https://interviewquestions.tuteehub.com/tag/regular-1182473" style="font-weight:bold;" target="_blank" title="Click to know more about REGULAR">REGULAR</a> variables? Quote from: Helpmeh on February 20, 2010, 05:41:46 PM<blockquote>how would I do that with regular variables?<br/></blockquote> <br/>Essentially you are splitting a string into two parts: (1) From the start to the final token delimiter, (2) the rest. Since <a href="https://interviewquestions.tuteehub.com/tag/dealing-2566191" style="font-weight:bold;" target="_blank" title="Click to know more about DEALING">DEALING</a> with drives, paths and filenames is a pretty common task, cmd.exe has this built in.<br/><br/>One way is to get the ordinary variable into a FOR metavariable...<br/><br/> Code: <a>[Select]</a>echo off<br/>set var=C:\Documents and Settings\User\My Documents\folder_a\b.txt<br/>for /f "tokens=*" %%A in ("%var%") do set DriveAndPath=%%~dpA<br/>echo %DriveAndPath%<br/><br/>...or pass it to a called label "subroutine"<br/><br/> Code: <a>[Select]</a>echo off<br/>goto start<br/><br/>:getpath<br/>set DriveAndPath=%~dp1<br/>goto :eof<br/><br/>:start<br/>set var=C:\Documents and Settings\User\My Documents\folder_a\b.txt<br/>call :getpath "%var%"<br/>echo %DriveAndPath% <br/>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.<br/><br/>The %~<a href="https://interviewquestions.tuteehub.com/tag/n-236724" style="font-weight:bold;" target="_blank" title="Click to know more about N">N</a> and %~x modifiers work on URLs as well. (The others do not give very useful values)<br/><br/>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.<br/><br/> Quote from: Helpmeh on February 20, 2010, 05:16:46 PM<blockquote>Is there a way to remove the last section of a string, divided by \? For example:<br/><br/>C:\Documents and Settings\User\My Documents\folder_a\b.txt<br/>would become<br/>C:\Documents and Settings\User\My Documents\folder_a\<br/>But the problem is, I don't know how long the wanted part is, or the unwanted (the file name).<br/></blockquote> <br/>vbscript,<br/> Code: <a>[Select]</a>Set objFS = CreateObject("Scripting.FileSystemObject")<br/>Set objArgs = WScript.Arguments<br/>strPath = objArgs(0)<br/>WScript.Echo objFS.GetParentFolderName(strPath)<br/><br/>on command line, pass your path as arguments to the script<br/> Code: <a>[Select]</a>C:\test>cscript //nologo getpath.vbs "c:\Documents and Settings\Administrator\Desktop\shortcutlnk"<br/>c:\Documents and Settings\Administrator\Desktop<br/>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...<br/><br/> Code: <a>[Select]</a>echo off<br/>REM get all but last token<br/>set string=C:\Documents and Settings\User\My Documents\folder_a\b.txt<br/>REM <a href="https://interviewquestions.tuteehub.com/tag/may-557248" style="font-weight:bold;" target="_blank" title="Click to know more about MAY">MAY</a> be useful<br/>set tokencount=1<br/>REM this format can handle white space delimiter<br/>set "delimiter=\"<br/>REM If delim is a space do this<br/>REM set "delimiter= "<br/>REM Create temp string for result<br/>set ResultString=<br/>:startloop<br/> REM get the first token in %%A and the remainder in %%B<br/> for /f "tokens=1* delims=%delimiter%" %%A in ("%string%") do (<br/> REM no trailing spaces!<br/> set "firsttoken=%%A"<br/> REM if remainder is blank then<br/> REM we have got to the end<br/> REM so exit<br/> if "%%B"=="" goto exitloop<br/> REM otherwise collect the remainder<br/> set restofstring=%%B<br/> )<br/> REM add first token and delimiter to result string<br/> set ResultString=%ResultString%%firsttoken%%delimiter%<br/> REM Chop off first token<br/> set string=%restofstring%<br/> REM may be useful<br/> set /a tokencount+=1<br/> REM go round again<br/> goto startloop<br/>:exitloop<br/>REM this is the last (unwanted) token<br/>set lastttoken=%restofstring%<br/>echo Result=%ResultString%<br/></body></html> | |
39. |
Solve : A way to turn off the archive bit in every file in C:\? |
Answer» <html><body><p>I need a way to <a href="https://interviewquestions.tuteehub.com/tag/turn-767121" style="font-weight:bold;" target="_blank" title="Click to know more about TURN">TURN</a> off the <a href="https://interviewquestions.tuteehub.com/tag/archive-381387" style="font-weight:bold;" target="_blank" title="Click to know more about ARCHIVE">ARCHIVE</a> 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:\.<br/><br/>I have found a MS KB #67941 which does at least the one file resetting the H bit. I assume the AND fffd can be changed to do the A bit. Then how can this be put in a batch file, or whatever, to run when desired? Or is there another better way?<br/><br/>Many thanks to anyone who can show me the way.<br/><br/>SnowmanRemove the archive switch? This code should work, but it will take a long time to process, depending on how many files you have on the C drive.<br/><br/>echo off<br/>for /f "delims=" %%a in ('dir /b /s C:\') do attrib -a "%%a"<br/>pauseThanks Helpmeh. <br/><br/>Put your suggestion in a batch file and got a syntax error. <br/><br/>Would you please explain the code. <br/><br/>How should I set it up so I can like push a button each time I want it to run.<br/><br/>SnowmanStrange...the code works for me...Although I removed the C:\ so I could run the batch file and it would remove the archive attribute in all the files in the work directory.helpmeh... all your code does is emulate the /s switch.<br/><br/>attrib has a /s switch, btw, so attrib *.* -a /s would accomplish the same thing.<br/><br/>however, the main issue here is that it will refuse to change the attributes on hidden or system files.<br/><br/>you could do:<br/><br/>attrib *.* -s -h -a /s<br/><br/><br/>but this has another problem since we don't want to permanently remove the hidden and system attributes, bringing us back to the iterative loop idea.<br/><br/><br/>Anyway, to cut a long story short I spent at least an hour trying to make a batch solution. Gave up, and then wrote a VBScript in about 5 minutes <br/><br/> Code: <a>[Select]</a>Dim FSO<br/>Dim usefolder<br/><br/>set FSO = CreateObject("Scripting.FileSystemObject")<br/><br/>set usefolder= FSO.GetFolder(CreateObject("WScript.Shell").CurrentDirectory)<br/><br/><br/>'WScript.Echo usefolder.name <br/><br/>Removearchiveattrib usefolder <br/><br/>Sub RemoveArchiveAttrib(InFolder)<br/><br/>Dim CurrFile,CurrFolder<br/><br/>For Each CurrFile in InFolder.Files<br/> if (Currfile.Attributes And 32)=32 then<br/> 'has the archive attribute, remove it.<br/> currfile.attributes = currfile.attributes-32<br/> 'WScript.echo "archive attribute found on file:" & currfile.name <br/> <br/> end if <br/><br/><br/>Next <br/>for each Currfolder in InFolder.SubFolders<br/> RemoveArchiveAttrib Currfolder <br/><br/>Next <br/><br/>End Sub<br/><br/>I tested this, and it works great for me 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.<br/><br/>for the record, the batch code that I had (which failed to work at all) was this:<br/><br/> Code: <a>[Select]</a>SETLOCAL ENABLEDELAYEDEXPANSION<br/><br/>for /f "delims==*" %%i in ('dir /s /b /a') do (<br/>echo working on "%%i"<br/>attrib "%%i" | findstr "^A H "<br/>if not <a href="https://interviewquestions.tuteehub.com/tag/errorlevel" style="font-weight:bold;" target="_blank" title="Click to know more about ERRORLEVEL">ERRORLEVEL</a> 1 (<br/>echo file is hidden but not system %%i<br/><br/><br/>)<br/>attrib "%%i" | findstr "^A S "<br/>if not errorlevel 1 (<br/>echo file is system, but not hidden %%i<br/><br/><br/>)<br/>attrib "%%i" | findstr "^A SH "<br/>if not errorlevel 1 (<br/>echo file is system and hidden %%i<br/><br/>)<br/><br/><br/><br/><br/>)<br/>attrib %0.bat -h -s<br/>there were attrib commands in each block which basically removed the attribute it discovered, removed the archive attribute, and then set back the original attributes. problem was the last test for system AND hidden was always true so it would end up with both System and hidden regardless of the original attributes. It wouldn't ahve the archive attribute anymore, though. So At least there was that.<br/><br/>Thank you BC_Programmer for spending so much time. I really appreciate it when someone spends time to really try to help rather that a short incomplete answer or really just a clue that seldom is enough to know where to go next.<br/><br/>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. Also the help for VBA editor is missing also. I will have to get the installation disk sent to me from home in Massachusetts. I am wintered here in Arizona. Will post after I get that installed. Is your script good for Excel 2000? <br/><br/>I using this Dell Studio 1737 Vista 64 for most everything else. The reason from maintaining the 98 machine is the need for the serial port to download from a data logger that won't work with any USB adapter.<br/><br/>Just for kicks the following is the Debug routine in the MS KB. The fffd would need to be adjusted to select the Archive bit. I tried changing it to dfff but am not sure of that:<br/><br/>The method described below uses DEBUG to create a small program that removes the hidden attribute from a file. This method should be used only as a last resort. <br/>At the MS-DOS prompt, type the following commands: <br/> DEBUG<br/> A 100<br/> mov dx,116<br/> mov ax,4300<br/> <br/> int 21<br/> and cx,fffd<br/> mov dx,116<br/> mov ax,4301<br/> int 21<br/> int 20<br/> <br/> E 116 'filename' 0 <------- replace "filename" with the path<br/> G and filename of the target file.<br/> Example: e 116 'C:\DATA\TEST.DAT' 0<br/> <br/><br/>When you type the command "G," DEBUG executes the section of code in memory. If you have typed everything correctly, the message "Program terminated normally" is displayed. <br/>Type Q to quit DEBUG, then verify that the file is no longer hidden. <br/>Back to the top<br/>Code Explanation<br/><br/><br/>The following is a detailed description of the preceding code: <br/>mov dx,116 ; load the offset to filename into dx<br/>mov ax,4300 ; load get/set file attributes function number into ax<br/> <br/>int 21 ; call DOS interrupt 21H to read attribute information<br/> <br/>and cx,fffd ; strip off only hidden attribute bit<br/>mov dx,116 ; load the offset to filename into dx<br/>mov ax,4301 ; load get/set file attributes function number into ax<br/> <br/>int 21 ; call DOS interrupt 21H to write attribute information<br/>int 20 ; terminate program<br/> <br/><br/>The program begins by calling Int 21H function 43H to get the current file attribute. The attribute byte is returned in register CX, which is then ANDed with hex FFFD to reset bit 1. The program calls the get/set file attribute function again to write the attribute in register CX to the file. Quote</p><blockquote>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.<br/></blockquote> <br/>Win 98SE <a href="https://interviewquestions.tuteehub.com/tag/includes-1039937" style="font-weight:bold;" target="_blank" title="Click to know more about INCLUDES">INCLUDES</a> VBScript and the ActiveX Scripting Host.<br/><br/>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.<br/><br/>Not sure exactly what is going on with the debug scripts(despite your thorough explanation, I'm dreadfully sleepy at the moment <em>EDIT: and no, not because of the explanation.... </em>), 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.<br/><br/><br/><br/><br/>Thanks again.<br/><br/>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. <br/><br/>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?<br/><br/>Snowman Quote<blockquote>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.<br/></blockquote> <br/>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.<br/><br/>Where can quickly find more information to use VBS?<br/><br/>Again, Thanks for the extraordinary help.<br/><br/>Snowman Quote from: Snowman on February 19, 2010, 04:15:54 PM<blockquote>Where can quickly find more information to use VBS?<br/></blockquote> <br/>the MS <a href="https://interviewquestions.tuteehub.com/tag/reference-1181544" style="font-weight:bold;" target="_blank" title="Click to know more about REFERENCE">REFERENCE</a> material can be found <a href="https://msdn.microsoft.com/en-us/library/t0aew7h6%28VS.85%29.aspx">here</a>.<br/><br/>First it's important to know the various "dialects" of the core Visual Basic language.<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/>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.<br/><br/> Quote<blockquote>Again, Thanks for the extraordinary help.<br/><br/></blockquote> your welcome <br/><br/></body></html> | |
40. |
Solve : Problem with the folder name in a for command? |
Answer» <html><body><p>Hi,<br/><br/>If you can see in the lines below I am trying to rename all the txt files to the foldername.<br/><br/>exampel: this is now:<br/>c:/test/a123/test.txt<br/>c:/test/b123/test.txt<br/>c:/test/a b (2009)/test.txt<br/><br/>and it should be:<br/>c:/test/a123/a123.txt<br/>c:/test/b123/b123.txt<br/>c:/test/a b (2009)/a b (2009).txt<br/><br/>hours of searching and this is the closest thing I've got, only I can't figur out what I've to type with the<br/>FOLDERNAME.txt below:<br/><br/>-----------------<br/><br/>echo off<br/><br/>for /f "delims==" %%b in ('dir /b /s /on *.txt') do rename "%%~b" "FOLDERNAME.txt" & echo %%~b <br/><br/>pause<br/><br/>-----------------<br/><br/>I hope <a href="https://interviewquestions.tuteehub.com/tag/someone-25657" style="font-weight:bold;" target="_blank" title="Click to know more about SOMEONE">SOMEONE</a> can help me because I am trying to fix this from yesterday.<br/><br/>Kris Code: <a>[Select]</a>echo off<br/>set thisdir="%cd%"<br/>for /f "delims==" %%A in ('dir /b /s /ad') do if exist "%%A\*.txt" cd %%A & for %%B in (*.txt) do ren "%%~dpnxB" "%%~nA.txt"<br/>cd %thisdir%<br/>Hi,<br/><br/>Thank you this is what I was <a href="https://interviewquestions.tuteehub.com/tag/looking-1079184" style="font-weight:bold;" target="_blank" title="Click to know more about LOOKING">LOOKING</a> for!<br/><br/>It works <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: squab on <a href="https://interviewquestions.tuteehub.com/tag/february-460109" style="font-weight:bold;" target="_blank" title="Click to know more about FEBRUARY">FEBRUARY</a> 20, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 07:10:53 AM</p><blockquote>It works <br/></blockquote> <br/>I know it works...<br/><br/>Glad to help.<br/><br/><br/><br/></body></html> | |
41. |
Solve : Issues with start command? |
Answer» <html><body><p>Im creating a VB program and in that program I create a batch file that...<br/> Code: <a>[Select]</a><a href="https://interviewquestions.tuteehub.com/tag/echo-11626" style="font-weight:bold;" target="_blank" title="Click to know more about ECHO">ECHO</a> off<br/>:loop<br/>echo. C:\Program Files\PeaZip\peazip.exe started at %time% >>server.log<br/>start /wait C:\Program Files\PeaZip\peazip.exe<br/>echo. C:\Program Files\PeaZip\peazip.exe crashed at %time% >>server.log<br/>goto loop<br/>Just using peazip as an example. But basically I want the <a href="https://interviewquestions.tuteehub.com/tag/script-345000" style="font-weight:bold;" target="_blank" title="Click to know more about SCRIPT">SCRIPT</a> to start a server and if it crashes restart it.<br/><br/>Well when I run that script I get the following:<br/><br/><a href="https://img687.imageshack.us/i/84077926.png/"></a><br/>Windows cannot find 'C:\program'. Make sure you typed the name correctly and try again.<br/><br/>Whats happening here?Sorry, I can't see that image (Netfilter... ), can you just write it out?<br/><br/>Pre-post Edit: I see the <a href="https://interviewquestions.tuteehub.com/tag/problem-25530" style="font-weight:bold;" target="_blank" title="Click to know more about PROBLEM">PROBLEM</a> just looking at the code. Paths with spaces need to be enclosed with quotes. So your path <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> be:<br/>"C:\Program Files\PeaZip\peazip.exe"<br/>Understand?I understand, and I have tried that. However when I put it in quotes it just starts a new DOS with the <a href="https://interviewquestions.tuteehub.com/tag/title-246221" style="font-weight:bold;" target="_blank" title="Click to know more about TITLE">TITLE</a> "C:\Program Files\PeaZip\peazip.exe"OK ignore this post. Quotes put it on the title yes, but if i do:<br/><br/>start /wait "" "C:\Blah Blah\Blah.exe" it works. I just needed a double set of quotes. THanks!</p></body></html> | |
42. |
Solve : The mode command.? |
Answer» <html><body><p>I saw that in the game "D.E.A.D V2" they <a href="https://interviewquestions.tuteehub.com/tag/used-763273" style="font-weight:bold;" target="_blank" title="Click to know more about USED">USED</a> a mode command in the <a href="https://interviewquestions.tuteehub.com/tag/beginning-894536" style="font-weight:bold;" target="_blank" title="Click to know more about BEGINNING">BEGINNING</a>. What does it do and how can You use it (or how I can use it).<br/>And the dude made the game without any arithmetic <a href="https://interviewquestions.tuteehub.com/tag/operators-11639" style="font-weight:bold;" target="_blank" title="Click to know more about OPERATORS">OPERATORS</a> (of which I still can't figure out, any examples?). How did he do that? His source code is at: <a href="http://odn.t35.com/dead/">http://odn.t35.com/dead/</a><br/>C:\>mode /?<br/>Configures system devices.<br/><br/>Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]<br/> [to=on|off] [xon=on|off] [odsr=on|off]<br/> [octs=on|off] [dtr=on|off|hs]<br/> [rts=on|off|hs|tg] [idsr=on|off]<br/><br/>Device Status: MODE [device] [/STATUS]<br/><br/>Redirect printing: MODE LPTn[:]=COMm[:]<br/><br/>Select code page: MODE CON[:] CP SELECT=yyy<br/><br/>Code page status: MODE CON[:] CP [/STATUS]<br/><br/>Display mode: MODE CON[:] [COLS=c] [liNES=n]<br/><br/>Typematic rate: MODE CON[:] [RATE=r DELAY=d]<br/><br/>C:\></p></body></html> | |
43. |
Solve : My Batch game..? |
Answer» <html><body><br/>I released this here about <a href="https://interviewquestions.tuteehub.com/tag/2-236987" style="font-weight:bold;" target="_blank" title="Click to know more about 2">2</a> <a href="https://interviewquestions.tuteehub.com/tag/years-239545" style="font-weight:bold;" target="_blank" title="Click to know more about YEARS">YEARS</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/creator-427372" style="font-weight:bold;" target="_blank" title="Click to know more about CREATOR">CREATOR</a> and <a href="https://interviewquestions.tuteehub.com/tag/item-770211" style="font-weight:bold;" target="_blank" title="Click to know more about ITEM">ITEM</a> creator thank you and <a href="https://interviewquestions.tuteehub.com/tag/enjoy-1707745" style="font-weight:bold;" target="_blank" title="Click to know more about ENJOY">ENJOY</a> !</body></html> | |
44. |
Solve : Batch AI, graphics and other impossible batch ideas? |
Answer» <html><body><p>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<br/>:main<br/>commands here<br/>set /p input=Enter your command here^> <br/>if /I "%input%"=="main" goto main<br/>if /I "%input%"=="close" Echo BYE&pause>nul&exit<br/><br/><br/>A patcher, funny you should ask about that. I was actually in the process of making a patcher (well actually an old-version replacer). It encorporates the FTP command and it calls the version it should be, and if the user's version isn't that, it will replace it with a newer version. But, judging by your code in your other thread, I think you need to start smaller and work your way up. What you can do though, is write down those ideas (I wish I did that lol) and when you have enough <a href="https://interviewquestions.tuteehub.com/tag/ability-25661" style="font-weight:bold;" target="_blank" title="Click to know more about ABILITY">ABILITY</a>, try and see if you can do it. Batch AI , is possible but very time consuming and a <a href="https://interviewquestions.tuteehub.com/tag/total-238051" style="font-weight:bold;" target="_blank" title="Click to know more about TOTAL">TOTAL</a> waste of time i wrote a simple one a long time ago, if you're still looking for a way to type a command on any screen and have it execute without having multiple if statements everywhere you can have all loops loop through another loop, taking only one line of code per area, and saving you hundreds of lines of code.. you can get ideas from my game here, odn.t35.com/DEAD Quote from: Helpmeh on <a href="https://interviewquestions.tuteehub.com/tag/february-460109" style="font-weight:bold;" target="_blank" title="Click to know more about FEBRUARY">FEBRUARY</a> 19, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 04:27:03 AM</p><blockquote>A patcher, funny you should ask about that. <br/></blockquote> <br/>I <a href="https://interviewquestions.tuteehub.com/tag/found-458144" style="font-weight:bold;" target="_blank" title="Click to know more about FOUND">FOUND</a> no humour value in his query. <br/><br/>However I respect your right to feel amused.<br/><br/>Continue.</body></html> | |
45. |
Solve : Batch Game Save? |
Answer» <html><body><p>I am currently creating a batch game (297 lines of coding on my first <a href="https://interviewquestions.tuteehub.com/tag/day-244454" style="font-weight:bold;" target="_blank" title="Click to know more about DAY">DAY</a>!!!) but I can't get it to save your progress. <a href="https://interviewquestions.tuteehub.com/tag/please-601513" style="font-weight:bold;" target="_blank" title="Click to know more about PLEASE">PLEASE</a> HELP. ANYTHING WILL BE APRECIATED!!!We'll have to see the code to help....<br/>save to a txt, like this<br/> Quote</p><blockquote>name1 - progress1<br/>name2 - progress2</blockquote> What i did in my batch game ,<a href="https://interviewquestions.tuteehub.com/tag/found-458144" style="font-weight:bold;" target="_blank" title="Click to know more about FOUND">FOUND</a> 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...<br/><br/>score 993<br/><br/>Then for load, i used for /f and seperated it as <a href="https://interviewquestions.tuteehub.com/tag/tokens-1421690" style="font-weight:bold;" target="_blank" title="Click to know more about TOKENS">TOKENS</a>.. so score <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> become %%a and 993 would become %%b for example:<br/><br/><br/><strong>for /f "tokens=1*" %%a in (savefile.txt) Do set %%a=%%b</strong></body></html> | |
46. |
Solve : Multi file batch games?? |
Answer» <html><body><p>How can I make them in files, <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> 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? <br/><br/>jk, that sounds <a href="https://interviewquestions.tuteehub.com/tag/exactly-977868" style="font-weight:bold;" target="_blank" title="Click to know more about EXACTLY">EXACTLY</a> like me when I first started <br/><br/>Anyway, this would work.<br/><br/>echo off<br/>rem Add data to a text file.<br/>echo DATA &<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>; textfile<br/>pause<br/>rem Retrieve data from the text file.<br/>set /p variable=echo %variable%<br/>pause<br/>Check out my batch game, at ODN.T35.COM/DEAD <br/><a href="https://interviewquestions.tuteehub.com/tag/click-918865" style="font-weight:bold;" target="_blank" title="Click to know more about CLICK">CLICK</a> "Source" to view the full source, this will give you a better idea on how to make your own.. Quote from: dnthns87 on <a href="https://interviewquestions.tuteehub.com/tag/february-460109" style="font-weight:bold;" target="_blank" title="Click to know more about FEBRUARY">FEBRUARY</a> 19, 2010, 01:56:52 PM</p><blockquote>Check out my batch game, at ODN.T35.COM/DEAD <br/>Click "Source" to view the full source, this will give you a better idea on how to make your own..<br/></blockquote> Your link is as it says...DEAD.Impressive...</body></html> | |
47. |
Solve : Run Windows Media Player in Background? |
Answer» <html><body><p>Hi All,<br/><br/>I'm trying to right a batch file that will run a .wav file in WMP in the background so the user won’t see the WMP window. At the moment here is the following code I've written.<br/><br/>--------------------------------<br/>start /MIN "wmplayer.exe" "C:\Users\Owner\Desktop\wavFiles\8point1.wav"<br/>timeout /T 3<br/>taskkill/IM "wmplayer.exe"<br/>------------------------------------------------<br/><br/>The problem with this code is that the WMP window does show and does not even minimize!<br/><br/>Any help will be very much appreciated!<br/>Try this. It will use an older version of windows media player, but not to worry as the user probably wont see it anyway.<br/> Code: <a>[<a href="https://interviewquestions.tuteehub.com/tag/select-630282" style="font-weight:bold;" target="_blank" title="Click to know more about SELECT">SELECT</a>]</a>start /min "" "C:\Program Files\Windows Media Player\mplayer2.exe" /play /close "C:\Users\Owner\Desktop\wavFiles\8point1.wav"Make sure the above is ONE LINE.Thanks Helpmeh for your quick reply!<br/><br/>1) I needed to change mplayer2.exe to wmplayer.exe otherwise I'm getting an error that it can't find mplayer2<br/><br/>2) After making the above change if WMP was in Restore mode last time it was open then the first time I run the bat file it executes as I want (the window is not visible) the second time it will show and stay open, if I close it manually and run it again it will run as I wanted the 4th time it won’t and so forth... If the WMP was Maximised last time it was open running the bat file will always run WMP in max mode and stay open.<br/> <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> from: Amram Chayim Eirinberg on February 20, 2010, 12:20:58 PM</p><blockquote>Thanks Helpmeh for your quick reply!<br/><br/>1) I needed to change mplayer2.exe to wmplayer.exe otherwise I'm getting an error that it can't find mplayer2<br/><br/>2) After making the above change if WMP was in Restore mode last time it was open then the first time I run the bat file it executes as I want (the window is not visible) the second time it will show and stay open, if I close it manually and run it again it will run as I wanted the 4th time it won’t and so forth... If the WMP was Maximised last time it was open running the bat file will always run WMP in max mode and stay open.<br/><br/></blockquote> 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\.<br/><br/>mplayer2.cnt<br/>mplayer2.exe<br/>mplayer2.hlp<br/>mplayer2.inf<br/>mplayer2.pnf<br/><br/>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.<br/>Where is the link? Quite strange...it must not have copied...lol<br/><a href="http://www.infocellar.com/winxp/files/mplayer-winxp-files.zip">http://www.infocellar.com/winxp/files/mplayer-winxp-files.zip</a>mplay32 and sndrec32 can also play .wav files.Thanks Prince! Hi Helpmeh<br/><br/><br/>I've updated the batch to mplayer2.exe however I'm getting an error message that the entry point was not found. <br/><br/>I've attached a jpg of the error message<br/><br/>[Saving space, attachment deleted by admin]I really have never seen that error before. It might be because it is for XP, not vista. <br/><br/>To make sure you don't have mplayer2.exe on you <a href="https://interviewquestions.tuteehub.com/tag/computer-243299" style="font-weight:bold;" target="_blank" title="Click to know more about COMPUTER">COMPUTER</a> (other than the one I gave you), do a search for it, and if it already exists, then it should work with that version. <br/><br/>there is no "mplayer2" included with windows vista.<br/><br/>use Windows Media Player Classic:<br/><br/><a href="https://www.afterdawn.com/software/video_software/video_players/media_player_classic.cfm/v6_4_9_1__20080127_">http://www.afterdawn.com/software/video_software/video_players/media_player_classic.cfm/v6_4_9_1__20080127_</a><br/><br/>the switches are pretty similar:<br/><br/> Quote<blockquote> <br/>Usage: mplayerc.exe "pathname" [switches]<br/><br/>"pathname" The main file or directory to be loaded. (wildcards<br/> allowed)<br/>/dub "dubname" Load an additional <a href="https://interviewquestions.tuteehub.com/tag/audio-245346" style="font-weight:bold;" target="_blank" title="Click to know more about AUDIO">AUDIO</a> file.<br/>/dubdelay "file" Load an additional audio file shifted with XXms (if<br/> file contains "...DELAY XXms...")<br/>/d3dfs start rendering in D3D fullscreen mode.<br/>/sub "subname" Load an additional subtitle file.<br/>/filter "filtername" Load DirectShow filters from a dynamic link<br/> library. (wildcards allowed)<br/>/dvd Run in dvd mode, "pathname" means the dvd<br/> folder (optional).<br/>/dvdpos T#C Start playback at title T, chapter C<br/>/dvdpos T#hh:mm Start playback at title T, position hh:mm:ss<br/>/cd Load all the tracks of an audio cd or (s)vcd,<br/> "pathname" means the drive path (optional).<br/>/open Open the file, don't automatically start playing.<br/>/play Start playing the file as soon the player is<br/> launched.<br/>/close Close the player after playback (only works when<br/> used with /play).<br/>/shutdown Shutdown the operating system after playback<br/>/fullscreen Start in full-screen mode.<br/>/minimized Start in minimized mode.<br/>/new Use a new instance of the player.<br/>/add Add "pathname" to playlist, can be combined<br/> with /open and /play.<br/>/regvid Create file associations for video files<br/>/regaud Create file associations for audio files<br/>/unregall Remove all file associations<br/>/start ms Start playing at "ms" (= milliseconds)<br/>/startpos hh:mm:ss Start playing at position hh:mm:ss<br/>/fixedsize w,h Set fixed window size.<br/>/<a href="https://interviewquestions.tuteehub.com/tag/monitor-563344" style="font-weight:bold;" target="_blank" title="Click to know more about MONITOR">MONITOR</a> N Start on monitor N, where N starts from 1.<br/>/help /h /? Show help about command line switches<br/><br/></blockquote> <br/>so you would use:<br/><br/> Code: <a>[Select]</a><path to mplayerc>\mplayerc.exe /minimized "%UserProfile%\desktop\wavfiles\8point1.wav" /play /close<br/>Wouldn't /minimized go on the other side of the path, with the other switches?<br/> Quote<blockquote>Usage: mplayerc.exe "pathname" [switches]</blockquote> it doesn't matter.ok.</body></html> | |
48. |
Solve : formating a new hard drive and installing windows 7? |
Answer» <html><body><p>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 <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/boot-251147" style="font-weight:bold;" target="_blank" title="Click to know more about BOOT">BOOT</a> 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.<br/> <br/>You don't need to use DOS commands at all to install Windows 7.<br/><br/>In fact, neither 2000, XP, Vista, nor 7 require DOS commands to install.<br/><br/>Don't use DOS at all. Just:<br/><br/>1) Put the Windows 7 DVD in the DVD drive (it is a DVD drive, right?)<br/>2) Go into your BIOS to change the boot order (usually by pressing "Delete," "F1," or "F2.") Alternatively, some PCs/motherboards have the <a href="https://interviewquestions.tuteehub.com/tag/option-25810" style="font-weight:bold;" target="_blank" title="Click to know more about OPTION">OPTION</a> to select the drive you want to boot from without going into the BIOS options. Usually, that key is F12, but it may not be that. Pay attention to what the initial screens tell you and see if there's an option to go into "Setup" or "Boot Order."<br/><a href="https://interviewquestions.tuteehub.com/tag/3-236794" style="font-weight:bold;" target="_blank" title="Click to know more about 3">3</a>) If you did #2 right, you should see "Press any key to boot from CD or DVD..." (sometimes this won't show up if the bootloader doesn't detect a formatted hard drive--it'll skip this altogether). If you see the prompt, press something, and the process should start from there.There is no dos prompt. Boot to the Windows CD and shortly after the install process starts you will be give the option to format before installing. <a href="https://interviewquestions.tuteehub.com/tag/whatever-736216" style="font-weight:bold;" target="_blank" title="Click to know more about WHATEVER">WHATEVER</a> you're doing, you are NOT booting to the Windows CD</p></body></html> | |
49. |
Solve : running executable? |
Answer» <html><body><p>Hi everyone<br/>Can I run an executable file from a <a href="https://interviewquestions.tuteehub.com/tag/batch-893737" style="font-weight:bold;" target="_blank" title="Click to know more about BATCH">BATCH</a> file that is converted to executable?<br/>i.e. can I double <a href="https://interviewquestions.tuteehub.com/tag/click-918865" style="font-weight:bold;" target="_blank" title="Click to know more about CLICK">CLICK</a> my batch file to let it <a href="https://interviewquestions.tuteehub.com/tag/launch-246614" style="font-weight:bold;" target="_blank" title="Click to know more about LAUNCH">LAUNCH</a> some executable file?<br/><br/>thanksstart "" "c:\a.<a href="https://interviewquestions.tuteehub.com/tag/exe-447113" style="font-weight:bold;" target="_blank" title="Click to know more about EXE">EXE</a>" Quote</p><blockquote>can I double click my batch file to let it launch some executable file?<br/></blockquote> <br/>Sure, why not? I'm <a href="https://interviewquestions.tuteehub.com/tag/surprised-1235927" style="font-weight:bold;" target="_blank" title="Click to know more about SURPRISED">SURPRISED</a> you didn't just try and see what would happen.<br/><br/>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.<br/><br/></body></html> | |
50. |
Solve : Batch Books and How much skill will I need?? |
Answer» <html><body><p>I know that I'm not there yet, but within some time in my life I want to <a href="https://interviewquestions.tuteehub.com/tag/write-746491" style="font-weight:bold;" target="_blank" title="Click to know more about WRITE">WRITE</a> a book on text based <a href="https://interviewquestions.tuteehub.com/tag/game-247031" style="font-weight:bold;" target="_blank" title="Click to know more about GAME">GAME</a> making with batch, but I still have a few questions.<br/>1. What is %%blahblahblah (I know about %how_variables_have_percent_marks_around_them% But what about %%This_is_it_a_variable)<br/>2. How do I rig a batch game up to a server<br/>3. How could it be possible to make a game maker out of batch (of course, making games within batch's limitations)<br/>4. How could I make Batch AI, graphics (not ASCII), learn a language resembling batch, embed batch or embed things into batch or let characters like ALT_1 or ALT_168 come up without my program crashing.<br/>5. Why do some people need compilers for batch but I don't?<br/>6. Is there a way to make a language resembling batch? How?<br/>Any books that you know of or sites (or other <a href="https://interviewquestions.tuteehub.com/tag/forms-11384" style="font-weight:bold;" target="_blank" title="Click to know more about FORMS">FORMS</a> of reference) that I can use?1. Look at FOR /?<br/>2. <br/>3. A game <strong>maker</strong>? <br/>4. Batch is based off of MS-DOS, a command line interface. There are no graphics. Alt characters do display properly. If you don't know if a character will display, put a ^ before it. <br/>5. Batch files don't need compilers. Other programming languages do. <br/>6. <strong>Make</strong> a language? Biting off more than you can chew again?You'd be <a href="https://interviewquestions.tuteehub.com/tag/surprised-1235927" style="font-weight:bold;" target="_blank" title="Click to know more about SURPRISED">SURPRISED</a> at what languages I know (<a href="https://interviewquestions.tuteehub.com/tag/markups-7263501" style="font-weight:bold;" target="_blank" title="Click to know more about MARKUPS">MARKUPS</a>).<br/>HTML<br/>Batch (sorta)<br/>XHTML<br/>CSS<br/>JavaScript<br/>XML<br/>Bits of C++</p></body></html> | |