

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.
301. |
Solve : Hi,, I need to change image sequece file names into one line name? |
Answer» <html><body><p>Hi,, I need to fix this problem now. <br/><br/>I am making a batch script. It is about that if users drag and drop the first image file in a folder, the script should read what the last file name is and it will get <a href="https://interviewquestions.tuteehub.com/tag/one-241053" style="font-weight:bold;" target="_blank" title="Click to know more about ONE">ONE</a> sequence file name.<br/><br/>For example, there is a folder with images like "test.0002.jpg", "test.0002.jpg", "test.0002.jpg", "test.0003.jpg", "test.0004.jpg", "test.0005.jpg", "test.0006.jpg", "test.0007.jpg". If I drag the first image, "test.0002.jpg", and I drop it into .bat, it should automatically change like "test.0002-0007.jpg".<br/><br/>When I test my script, it can read first image, but it can't read whole images.<br/><br/>My script is <br/>===========================================================<br/>:convertMOVIE<br/>IF %1 == "" GOTO end<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" %1 "%~d1%~p1%~n1.<a href="https://interviewquestions.tuteehub.com/tag/mov-548852" style="font-weight:bold;" target="_blank" title="Click to know more about MOV">MOV</a>" <br/>SHIFT<br/>GOTO convertMOVIE<br/>:end<br/>ECHO.<br/>ECHO Done!<br/>pause<br/>============================================================<br/><br/>"div_convert.exe" is a free software to convert image sequece to quicktime format. <br/>The basic command is like "div_convert.exe test.001-005.jpg test.mov"<br/><br/>Please help me...<br/><br/>Thank you.1. Is the numerical sequence, 0002, 0007, etc, always 4 digits, <br/>2. Is it always at the end of the name part of the filename?<br/>3. Do you mean you want to change just the first filename of the sequence?<br/><br/> Quote</p><blockquote>it can read first image, but it can't read whole images.</blockquote> <br/>I am not sure what you mean by this.<br/>Hi.. Thank you for the response.<br/><br/>1. numerical sequence number is different. sometimes 5 digits, sometimes 3 digits<br/><br/>2. test.0002.jpg, test.0003.jpg, test.0004.jpg, test.0005.jpg.... <br/><br/>3. ex, there are 5 files, like image.0004.jpg, image.0005.jpg, image.0006.jpg, image.0007.jpg, image.0008.jpg<br/>i want to convert these to movie. The converter should reand these sequence files to "image.0004-0008.jpg"<br/>Then it executes as "div_convert.exe image.0004-0008.jpg test.mov" It will make a movie. Quote from: ylthh on October 16, 2010, 01:19:21 PM<blockquote>Hi,, I need to fix this problem now. <br/><br/>I am making a batch script. It is about that if users drag and drop the first image file in a folder, the script should read what the last file name is and it will get one sequence file name.<br/><br/>For example, there is a folder with images like "test.0002.jpg", "test.0003.jpg", "test.0004.jpg", "test.0005.jpg", "test.0006.jpg", "test.0007.jpg". If I drag the first image, "test.0002.jpg", and I drop it into .bat, it should automatically change like "test.0002-0007.jpg".<br/><br/>When I test my script, it can read first image, but it can't read whole images.<br/><br/>My script is <br/>===========================================================<br/>:convertMOVIE<br/>IF %1 == "" GOTO end<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" %1 "%~d1%~p1%~n1.mov" <br/>SHIFT<br/>GOTO convertMOVIE<br/>:end<br/>ECHO.<br/>ECHO Done!<br/>pause<br/>============================================================<br/><br/>"div_convert.exe" is a free software to convert image sequece to quicktime format. <br/>The basic command is like "div_convert.exe test.001-005.jpg test.mov"<br/><br/>Please help me...<br/><br/>Thank you.<br/></blockquote> So you just rename the first file?<br/><br/>Why have you <a href="https://interviewquestions.tuteehub.com/tag/quoted-2236199" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTED">QUOTED</a> yourself?<br/><br/>correct, rename the first file.is filename format always something dot NNNN dot jpg like this: abcd.0001.jpg? (always three parts separated by dots?)<br/><br/><br/>yes Code: <a>[Select]</a>echo off<br/>set fullname=%~1<br/>set foldernm=%~dp1<br/>set barename=%~nx1<br/>cd /d "%foldernm%"<br/>for /f "tokens=1-3 delims=." %%A in ("%barename%") do (<br/> set fileroot=%%A<br/> set firstnum=%%B<br/> set fileextn=%%C<br/> )<br/>set filespec=%fileroot%.*.%fileextn%<br/>for /f "tokens=1-3 delims=." %%A in ('dir /b "%filespec%"') do set lastnum=%%B<br/>set param1=%fileroot%.%firstnum%-%lastnum%.%fileextn%<br/>set param2=%fileroot%.mov<br/>"C:\Program Files (x86)\djv 0.8.2\bin\djv_convert.exe" "%param1%" "%param2%" <br/>pause<br/><br/>Hi, Salmon<br/><br/>Thank you so much for your help.<br/><br/>In network server, "dir /b" didn't work well. The file order is not alphabetical. Then I added dir /b /o, then it worked.<br/>Is it correct? Then when I execute batch file, it worked. <br/><br/>Thank you so much again. Quote from: ylthh on October 17, 2010, 09:02:10 AM<blockquote>In network server, "dir /b" didn't work well. The file order is not alphabetical. Then I added dir /b /o, then it worked.<br/>Is it correct?</blockquote> <br/>That sounds good to me.<br/><br/></body></html> | |
302. |
Solve : Replace the particular string using Dos batch program? |
Answer» <html><body><p>Hi, <br/><br/>I have text file ( fulllist.txt ) with following format contents<br/><br/>C:\<a href="https://interviewquestions.tuteehub.com/tag/program-246414" style="font-weight:bold;" target="_blank" title="Click to know more about PROGRAM">PROGRAM</a> Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube.mpg<br/>C:\Program Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube_intro.mpg<br/>-----<br/>-----<br/>-----<br/>C:\Program Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube_intro.mpg<br/>D:\Program Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube.mpg<br/>D:\Program Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube_intro.mpg<br/>-----<br/>-----<br/>-----<br/>D:\Program Files\Nero\Nero 9\Templates\Smart3D\Menus\4_3\Cube\cube_intro.mpg<br/><br/><br/>i want <a href="https://interviewquestions.tuteehub.com/tag/replace-karana-ka-sharatakata-622250" style="font-weight:bold;" target="_blank" title="Click to know more about REPLACE">REPLACE</a> "C:\" with "\\Server\" and "D:\" with "\\Server\"<br/><br/>how 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 batch file to open my file "Fulllist.txt" and replace the above string ?<br/><br/><br/><br/>Kindly help me.. <br/> Code: <a>[Select]</a>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> "delims=" %%A in (fulllist.txt) do echo \\Server\%%~pnxA Quote from: Salmon Trout on October 24, 2010, 05:20:26 AM</p><blockquote> Code: <a>[Select]</a>for /f "delims=" %%A in (fulllist.txt) do echo \\Server\%%~pnxA</blockquote> <br/>Thanks! <br/><br/>i want redirect the results new file.. <br/><br/> Quote from: csselva on October 24, 2010, 05:41:33 AM<blockquote>i want redirect the results new file..<br/></blockquote> <br/>I am sure you know how to do that.<br/><br/><br/><br/></body></html> | |
303. |
Solve : Batch to ping network range? |
Answer» <html><body><p>Trying to make a program to ping network range.<br/>the range is selected via SET /p and later called in the following segment. (I believe this is where I'm having issues.)<br/> Code: <a>[Select]</a>PING -n 1 %range%.2|find "reply from " >NUL<br/>IF NOT ERRORLEVEL 1 goto s1<br/>IF ERRORLEVEL 1 goto f1<br/>s1 echos a success script and will nbtstat the successful IP<br/>f1 returns fail and <a href="https://interviewquestions.tuteehub.com/tag/continues-2542063" style="font-weight:bold;" target="_blank" title="Click to know more about CONTINUES">CONTINUES</a> onto the next IP in the range<br/><br/>Is PING.exe reading the IP literally and thus <a href="https://interviewquestions.tuteehub.com/tag/returning-1187974" style="font-weight:bold;" target="_blank" title="Click to know more about RETURNING">RETURNING</a> false?<br/><br/>the target range was tested and showed a .....0.2 ip in the range.<br/><br/>EDIT** Changed the SET /p to a set IP still returning false when ARP is returning that the IP exists.could you give an example of a range that might be typed in using set /p? (that is a typical value of %range%)<br/><br/> Quote</p><blockquote>Is PING.exe reading the IP literally .. ?</blockquote> <br/>Not <a href="https://interviewquestions.tuteehub.com/tag/sure-656539" style="font-weight:bold;" target="_blank" title="Click to know more about SURE">SURE</a> what you mean by this.<br/><br/><br/><br/>It will run as so...<br/><br/> Code: <a>[Select]</a>set /p range= Please select Range: Quote<blockquote>user sees: Please select range:<br/>User types: 192.168.1<br/>Program runs: Code: <a>[Select]</a>ping -n 1 192.168.1.1 | find "reply" >nul<br/> IF NOT ERRORLEVEL 1 goto success<br/> IF ERRORLEVEL 1 goto fail</blockquote> It will loop till 254 on that range<br/> Quote from: Phuhrenzix on <a href="https://interviewquestions.tuteehub.com/tag/october-584768" style="font-weight:bold;" target="_blank" title="Click to know more about OCTOBER">OCTOBER</a> 27, 2010, 11:04:57 AM<blockquote>It will loop till 254 on that range<br/></blockquote> <br/>What do you mean by this?<br/><br/>it will start on 192.168.1.1 and end in 192.168.1.254 in this example.<br/>(the code is highly redundant because I couldn't get the FOR to loop and echo properly) Quote from: Phuhrenzix on October 27, 2010, 11:18:26 AM<blockquote>it will start on 192.168.1.1 and end in 192.168.1.254 in this example.<br/></blockquote> <br/>How does it do that?<br/>here, i'm probably not explaining well enough.<br/> Code: <a>[Select]</a>echo off<br/>SET /p username=User Name:<br/>SET /p password=Password:<br/>IF %password%==foo goto start<br/>ELSE goto try1<br/>:try1<br/>echo login failed 1/3<br/>SET /p password=Password:<br/>IF %password%==foo goto start<br/>:try2<br/>ELSE goto try2<br/>echo login failed 2/3<br/>SET /p password=Password:<br/>IF %password%==foo goto start<br/>ELSE goto try3<br/>:try3<br/>echo login failed 3/3<br/>SET /p password=Password:<br/>IF %password%==foo goto start<br/>ELSE goto end<br/>:start<br/>set /p range=please enter range:<br/>Echo sniff sniff sniff<br/>:1<br/>PING -n 1 %range%.1 |find "reply" >NUL<br/>IF NOT ERRORLEVEL 1 goto s1<br/>IF ERRORLEVEL 1 goto f1<br/>:s1<br/>echo sniff sniff sniff, %range%.1 lives!<br/>:f1<br/>echo whimper, sorry Master %username% I could not find %range%.1<br/>goto 2<br/>:2<br/>PING %range%.2|find "reply from " >NUL<br/>IF NOT ERRORLEVEL 1 goto s2<br/>IF ERRORLEVEL 1 goto <a href="https://interviewquestions.tuteehub.com/tag/f2-456229" style="font-weight:bold;" target="_blank" title="Click to know more about F2">F2</a><br/>:s1<br/>echo sniff sniff sniff, %range%.1 lives!<br/>goto 3<br/>:f1<br/>echo whimper, sorry Master %username% I could not find %range%.1<br/>goto 2<br/>.<br/>.<br/>.<br/>:end<br/>You seem to think that the ping command will ping a range of IP addresses, but you are only giving it one IP address.<br/><br/>it continues on<br/>:1 area pings %range%.1<br/>:2 area pings %range%.2<br/>:3 area pings %range%.3<br/> and so on<br/><br/><br/>like i said it is highly redundant and has a instance for 1-254 to ping, the actual code isnt one IP address, unless it's only pinging what is entered for range.You mean you have 254 separate labels and 254 separate sections? Is this true?<br/><br/>1. Why???<br/>2. Why did you not mention this before?<br/>3. What are you trying to do here? Is it some kind of hack?<br/><br/><br/><br/>1. because I want it to return if the IP's are existant on the network. and the FOR wouldn't run the echo's properly<br/>2. I was just with bad word choice<br/>3. This is an alternative to ARP(which doesnt return IP's on public networks) on public networks to be used by network administrators. If you want to think of it as a hack in that element, yes. If you're thinking it is a hack as in illegal, no. 1. Either make the string for FIND to be "Reply" with a capital R or else make the find case-insensitive with the /I switch.<br/>2. This is how to loop through a range of numbers using FOR<br/><br/> Code: <a>[Select]</a>REM example<br/>set range=192.168.1<br/>for /L %%N in (1,1,254) do PING %range%.%%N | find "Reply">nul && echo Reply from %range%.%%N<br/>I'm finally seeing results from this.... however, the return is returning even failed pings. Code: <a>[Select]</a>echo off<br/>REM example<br/>set range=192.168.1<br/>set num=1<br/>:loop<br/>PING -n 1 %range%.%num% | find "Reply from"> nul<br/>if %errorlevel% equ 0 (<br/> echo %range%.%num% YES<br/>) else (<br/> echo %range%.%num% NO<br/> ) <br/>set /a num+=1<br/>if %num% equ 255 goto next<br/>goto loop<br/>:next<br/>echo Completed pinging range %range% <br/>This is an awesome fix thanks, just one question though; why is the router not returning as existent?</body></html> | |
304. |
Solve : Batch file completion? |
Answer» <html><body><p>Hello<br/><br/>OS: Windows XP<br/>App: Access 2003 SP3<br/><br/>I am running a Batch file in <a href="https://interviewquestions.tuteehub.com/tag/vba-723235" style="font-weight:bold;" target="_blank" title="Click to know more about VBA">VBA</a> (see code below). I want to ensure the Batch file completes it's work (<a href="https://interviewquestions.tuteehub.com/tag/creating-427346" style="font-weight:bold;" target="_blank" title="Click to know more about CREATING">CREATING</a> a TXT file) before moving onto the <br/>next line of VBA. I currently Loop 20 million times before moving to the next line of VBA. This is a workaround... I'm looking for a solution. <br/><br/>VBA....<br/> 'Run external Batch file to collect documents<br/> Shell ("c:\BatchFile.bat"), vbMinimizedNoFocus<br/> 'Pause VBA until Batchfile completed!<br/>VBA....<br/><br/>Any help would be <a href="https://interviewquestions.tuteehub.com/tag/gratefully-7376025" style="font-weight:bold;" target="_blank" title="Click to know more about GRATEFULLY">GRATEFULLY</a> appreciated.<br/><br/>Regards<br/>MikeThere are a <a href="https://interviewquestions.tuteehub.com/tag/couple-251182" style="font-weight:bold;" target="_blank" title="Click to know more about COUPLE">COUPLE</a> of ways to do this. This <a href="http://www.cpearson.com/excel/ShellAndWait.aspx">link</a> describes one of them. I would suggest you run the <strong>shellandwait</strong> function in a loop until you receive a <em>success</em> return code.<br/><br/>Another possibility is to create a Windows Shell object in your code and use the <strong>run</strong> method to execute your batch file. Unlike the VBA shell command, the <strong>run</strong> method has a wait on return <a href="https://interviewquestions.tuteehub.com/tag/parameter-244658" style="font-weight:bold;" target="_blank" title="Click to know more about PARAMETER">PARAMETER</a> you can set to <em>true</em>. <br/><br/>Good luck. Many thanks... ShellAndWait works just perfect!</p></body></html> | |
305. |
Solve : File attribute change - run as administrator? |
Answer» <html><body><p>I need to copy / overwrite approxiamately 200 files located on a network share into a workstation subdirectory with 20 read only files. The target directory has an existing 300+ files. The target workstations do not have <a href="https://interviewquestions.tuteehub.com/tag/local-537549" style="font-weight:bold;" target="_blank" title="Click to know more about LOCAL">LOCAL</a> admin rights. I've created a successful batch file, but it runs as the local user account logged into the <a href="https://interviewquestions.tuteehub.com/tag/machine-550312" style="font-weight:bold;" target="_blank" title="Click to know more about MACHINE">MACHINE</a> and it generates "access denied" error. <br/><br/><br/>On a side note, I've used a tool by Dell, called KBOX and attempted to syncronize the files but it does not work either. My goal is to get the files copied to the workstations that <a href="https://interviewquestions.tuteehub.com/tag/users-25567" style="font-weight:bold;" target="_blank" title="Click to know more about USERS">USERS</a> have no permissions to. If anyone can help with another solution that would be great too.<br/><br/>Below is what I got so far. Can I run the attrib command on the same line. I can get the DOS window to pop up in run as mode, but can't <a href="https://interviewquestions.tuteehub.com/tag/seem-7258342" style="font-weight:bold;" target="_blank" title="Click to know more about SEEM">SEEM</a> to <a href="https://interviewquestions.tuteehub.com/tag/pass-244661" style="font-weight:bold;" target="_blank" title="Click to know more about PASS">PASS</a> my attrib command.<br/><br/>runas /user:strhospital\jortiz "cmd.exe attrib -r c:\program files\paragon94\."<br/><br/></p></body></html> | |
306. |
Solve : Batch trim audio files at regular/sequential intervals? |
Answer» <html><body><p>(hope I didn't post this twice - I think I was logged off on my first try)<br/><br/>I'm trying to efficiently create sequential two minute clips from a library of wav files. This sounds like a batch file to me but I haven't been able to solve the problem on my own.<br/><br/>Details: I have about 200 wav files spread over <a href="https://interviewquestions.tuteehub.com/tag/multiple-1105557" style="font-weight:bold;" target="_blank" title="Click to know more about MULTIPLE">MULTIPLE</a> directories and subdirectories. Each file is 10 to 20 minutes long. I want to take each file and make several two minute wav files from them. For example, if I had a 10 minute file named x, I want the output to be 1x, 2x, 3x, 4x, 5x where file 1x is a clip of the first two minutes of x, 2x is a clip starting at minute 2 and ending at 4 and so on. Ideally these would end up in a folder with the name of the parent file. I can easily do this with a single file using the Regular Interval Labels tool in Audacity but I don't know of a way to use this tool to process multiple files at once.<br/><br/>Does anyone have suggestions for me? I'm not experienced with for loops, but I thought maybe the combination of a for loop and an audio utility in Cygwin might do the job. However, I’m not familiar with a utility that can do this.<br/><br/>This is my first post here and I hope I'm not repeating a question that's been asked <a href="https://interviewquestions.tuteehub.com/tag/previously-7318154" style="font-weight:bold;" target="_blank" title="Click to know more about PREVIOUSLY">PREVIOUSLY</a>. I haven't found anything similar in my searches but just let me know if I should be looking at a past thread. Also, let me know if you need more information from me.<br/><br/>Am I'm using:<br/>XP<br/>MS DOS 5.1.2600<br/>Cygwin 1.7.7<br/>Audacity 1.3.12 Bata<br/>GoldWave 5.58<br/><br/>Thanks for any help you can offer!Out of curiosity, why do you want to break up these audio files? The answer might help some one else to offer a solution. Quote from: rthompson80819 on October 18, 2010, 04:26:34 PM</p><blockquote>Out of curiosity, why do you want to break up these audio files? The answer might help some one else to offer a solution.<br/></blockquote> <br/>Hi rthompson,<br/><br/>Thanks for the suggestion. The <a href="https://interviewquestions.tuteehub.com/tag/recordings-1180476" style="font-weight:bold;" target="_blank" title="Click to know more about RECORDINGS">RECORDINGS</a> are of bird choruses and the two minute segments will be used to test volunteer bird counter's ability to identify <a href="https://interviewquestions.tuteehub.com/tag/birds-343637" style="font-weight:bold;" target="_blank" title="Click to know more about BIRDS">BIRDS</a> by song. Maybe the best thing to do process each file on its own but I thought if there was a better way I should learn it.<br/><br/>Thanks. Code: <a>[Select]</a>MS DOS 5.1.2600<br/>There is no such animal; I <a href="https://interviewquestions.tuteehub.com/tag/believe-395244" style="font-weight:bold;" target="_blank" title="Click to know more about BELIEVE">BELIEVE</a> you mean Windows XP command line which is not MS-DOS. <br/><br/>If you can get the files into mp3 format, which is a trivial undertaking, you can use a tool called mp3splt which (among other things) can split an mp3 file into equal sized parts<br/><br/> Quote<blockquote>mp3splt -t 10.00 album.mp3 [Split album.mp3 in many equal-sized parts of 10 minutes each.]<br/><br/>mp3splt album.mp3 10.12 14.25 -o out.mp3 [Split album.mp3 starting at 10min 12sec, ending at 14mins 25sec and save the mp3 slice in a new file called out.mp3]</blockquote> <br/><a href="https://labnol.blogspot.com/2006/10/mp3-cutters-split-mp3-files-into.html">http://labnol.blogspot.com/2006/10/mp3-cutters-split-mp3-files-into.html</a><br/><br/><br/><br/>Great, thanks Salmon Trout! mp3splt looks like just what I need. And you are correct of course, I'm using the XP command prompt v. 5.1.2600. Not sure way I wrote MS DOS... I do know better</body></html> | |
307. |
Solve : Sound and Hidden Legacy Support?? |
Answer» <html><body><p>Hey guys, I'm confused. <br/><br/>Loaded MS-DOS on my Acer Aspire One (AOA150). It works just dandy. I loaded mouse.com. and my touchpad worked. But here's the confusing part:<br/><br/>I plugged in a <a href="https://interviewquestions.tuteehub.com/tag/usb-11337" style="font-weight:bold;" target="_blank" title="Click to know more about USB">USB</a> mouse, and it worked. No USB DOS drivers at all. I checked the BIOS for <a href="https://interviewquestions.tuteehub.com/tag/legacy-1071068" style="font-weight:bold;" target="_blank" title="Click to know more about LEGACY">LEGACY</a> Support, and there was none. But, if a USB mouse works without a DOS USB driver, doesn't this automatically mean that there is legacy support in the BIOS? Does this mean that my BIOS has legacy support, but it is on by default and hidden?<br/><br/>My second question:<br/>Now that the mouse works in DOS, I'd like to tackle, or at least explore, the much harder issue of getting sound to work. Using the program lspci from linux, I found that my onboard audio is "N10/ICH7 Intel (rev. 2)". At least, I hope this is accurate. Is there a driver that can make this work in DOS? And if my BIOS has legacy support, but it's hidden and undisclosed (weird), I assume that sound would/could already be working with no driver at all?<br/><br/>Any help is most appreciated, and if you <a href="https://interviewquestions.tuteehub.com/tag/get-11812" style="font-weight:bold;" target="_blank" title="Click to know more about GET">GET</a> sound working on my DOS netbook, I will let you have three of my five daughters (or credit you in a little multiboot DOS guide I'll write up -- your pick).<br/><br/> Quote from: princethrash on October 20, 2010, 10:05:07 AM</p><blockquote>Hey guys, I'm confused. <br/><br/>Loaded MS-DOS on my Acer Aspire One (AOA150). It works just dandy. I loaded mouse.com. and my touchpad worked. But here's the confusing part:<br/><br/>I plugged in a USB mouse, and it worked. No USB DOS drivers at all. I checked the BIOS for Legacy Support, and there was none. But, if a USB mouse works without a DOS USB driver, doesn't this automatically mean that there is legacy support in the BIOS? Does this mean that my BIOS has legacy support, but it is on by default and hidden?<br/></blockquote> Yes. It does. Mouse.com only works with Serial and PS/2 mice. Therefore the USB mice is acting as one of the two; almost certainly PS/2.<br/><br/><br/> Quote<blockquote>Now that the mouse works in DOS, I'd like to tackle, or at least explore, the much harder issue of getting sound to work. Using the program lspci from linux, I found that my onboard audio is "N10/ICH7 Intel (rev. 2)". At least, I hope this is accurate. Is there a driver that can make this work in DOS? And if my BIOS has legacy support, but it's hidden and undisclosed (weird), I assume that sound would/could already be working with no driver at all?<br/><br/>Any help is most appreciated, and if you get sound working on my DOS netbook, I will let you have three of my five daughters (or credit you in a little multiboot DOS guide I'll write up -- your pick).<br/></blockquote> <br/>"N10/ICH7 Intel (rev. 2)" is the IDE/SATA controller....<br/><br/>Chances are, with a netbook, or really any laptop, is that it uses Host-based processing, for example, it may claim to have say a "realtek high definition audio controller" or something to that <a href="https://interviewquestions.tuteehub.com/tag/effect-246841" style="font-weight:bold;" target="_blank" title="Click to know more about EFFECT">EFFECT</a>, but what this generally means is that the "controller" defers all the actual processing of the sound to the CPU. (I'm not sure if they've changed this). This is largely redundant- you would almost certainly need the sound device to emulate a Sound Blaster in order to use it. DOS does not and has never had native sound support; generally you would buy a sound card back in the good old days and it would come with a driver disk, and then you'd change config.sys to load the driver with very specific settings (and you would need to flip about jumpers and whatnot on the actual card to match the settings you choose in config.sys, and hope it doesn't conflict with something).<br/><br/>the drivers, however, were wholly unneeded a lot of the time. First off- DOS never emits sound through the sound card, and programs that did use the sound card would look for a certain environment variable, the "BLASTER" variable. this commonly set like this in autoexec.bat or config.sys:<br/><br/> Code: <a>[Select]</a>SET BLASTER=A220 I5 D1 H5 P330 E620 T6<br/><br/>This tells the game/program where to look for a sound card. IN fact I cannot think of a single game that needed you to load the included "drivers" disk, aside from the fact that it added this environment variable for you. Basically, I'd throw something like that into autoexec.bat and run a game/program that uses audio. <a href="https://interviewquestions.tuteehub.com/tag/nothing-581732" style="font-weight:bold;" target="_blank" title="Click to know more about NOTHING">NOTHING</a> included with DOS uses the sound card AFAIK.BC,<br/><br/>So I guess the question is, can this netbook's hardware emulate a SB?<br/><br/>I was playing with autoexec.bat SET BLASTER before posting, and I also tried your line, matching my programs configurations to the line (hex, dma, irq), but it still isn't working. I'm not new to these things, I have adjusted jumpers on modems back in DOS and Win95 days, and have editted config/autoexec many-a-time.<br/><br/>I think I need to identify the audio hardware before I can really diagnose the issue, do I not? So I can find out if it emulates an SB? I am unsure how to do this. I used DOS for years, and I am aware that drivers were not needed, the reason I mention drivers now is because, I assume, only some boards emulate SB (aka, DOS compatible) and others might need some "help".<br/><br/>As I said, I used lspci in linux and the only line with the word "audio" in it did indeed describe this as n10/ich7. Are you sure these designations refer only to IDE/SATA, and not something more general?</body></html> | |
308. |
Solve : pasword protection? |
Answer» <html><body><p>Hi to all. <br/><br/>I am kinda a biginer, and i am error prone with the writing of batch files. <br/>I have written a program that is sopposed to open a <a href="https://interviewquestions.tuteehub.com/tag/hidden-2109891" style="font-weight:bold;" target="_blank" title="Click to know more about HIDDEN">HIDDEN</a> folder, on my usb memory device I made it work once, but i accidentally erased a part of it, but it worked before i erased.<br/><br/>The file goes <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> this...<br/><br/>echo off<br/>color 0c<br/>title lOGIN<br/><br/><br/><br/>echo 000PASSWORD0 000<br/>echo 00000000000000 0000<br/>echo 00000000000000000 0000000<br/>echo 0000000000000000000 0000000000<br/>echo 000000000000000000000 0000000000<br/>echo 00000000000000000000000 00000000htp0<br/>echo 000000000000000000 0000000htp00<br/>echo 0000000000000000000 0000HTP000000<br/>echo 0000000000000000000 000HTP0000000<br/>echo 0000000000000000000 000000HTP0000<br/>echo 00000000000000000000 0000000HTP0000<br/>echo 000000000 000 000000 0000 00000000000000<br/>echo 0000000000 <a href="https://interviewquestions.tuteehub.com/tag/00-254995" style="font-weight:bold;" target="_blank" title="Click to know more about 00">00</a> 00000 00000000000000000000<br/>echo 000000000 00000 0000000000000000000<br/>echo 000000000 00000 0000000000 0000000<br/>echo 000000000 00000 00000 0000000<br/>echo 000000000000 000000 0000000<br/>echo 000000000000 00000 00000000<br/>echo 000000000000 000 0000000000<br/>echo 00000000000 0000000000<br/>echo 000000 00000000000<br/>echo 0000000 000000<br/>echo 0000000 0000000<br/>echo 00000000 00000000<br/>echo 00000000 00000000000<br/>echo 0000000000000 00000000000000<br/>echo 000all_files_will_be_deleted0000<br/>echo 0after_3_incorect attempts00<br/>echo 0000000WILLBURN000000<br/><br/><br/>echo Welcome, zERoBurN<br/>echo Continue?<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword <a href="https://interviewquestions.tuteehub.com/tag/required-1185621" style="font-weight:bold;" target="_blank" title="Click to know more about REQUIRED">REQUIRED</a><br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto NO<br/><br/>:YES<br/>start "allinfo"<br/>exit<br/><br/><br/>:no<br/><br/>echo incorrect password....<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword required<br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto next1<br/><br/><br/>next1<br/>echo incorrect password....<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword required<br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto next2<br/><br/>:next2<br/>echo incorect password<br/><br/>pause<br/><br/><br/>echo you have been terminated<br/>echo This file and all subfoders are now deleted<br/>del allinfo\access.bat<br/>shutdown -i<br/>pause<br/><br/><br/><br/>I was also having trouble with getting it to shutdown. any help would be nice, or anything you think i should add. the reason for the no directory name is that computers change the name of the directory a lot, so i want it universal, this feature worked before. <br/><br/>and the immage at the biggining looks deformed, but that is the diference between notepad and this.\<br/><br/>Thanks for all the helpalso, to add, i am on a vista system right now, but i primarily use xp. I still want it universal for any windows computer<br/>thankstry This<br/> <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>[Select]</a>echo off<br/>color 0c<br/>title lOGIN<br/>cd..<br/><br/><br/><br/>echo 000PASSWORD0 000<br/>echo 00000000000000 0000<br/>echo 00000000000000000 0000000<br/>echo 0000000000000000000 0000000000<br/>echo 000000000000000000000 0000000000<br/>echo 00000000000000000000000 00000000htp0<br/>echo 000000000000000000 0000000htp00<br/>echo 0000000000000000000 0000HTP000000<br/>echo 0000000000000000000 000HTP0000000<br/>echo 0000000000000000000 000000HTP0000<br/>echo 00000000000000000000 0000000HTP0000<br/>echo 000000000 000 000000 0000 00000000000000<br/>echo 0000000000 00 00000 00000000000000000000<br/>echo 000000000 00000 0000000000000000000<br/>echo 000000000 00000 0000000000 0000000<br/>echo 000000000 00000 00000 0000000<br/>echo 000000000000 000000 0000000<br/>echo 000000000000 00000 00000000<br/>echo 000000000000 000 0000000000<br/>echo 00000000000 0000000000<br/>echo 000000 00000000000<br/>echo 0000000 000000<br/>echo 0000000 0000000<br/>echo 00000000 00000000<br/>echo 00000000 00000000000<br/>echo 0000000000000 00000000000000<br/>echo 000all_files_will_be_deleted0000<br/>echo 0after_3_incorect attempts00<br/>echo 0000000WILLBURN000000<br/><br/><br/>echo Welcome, zERoBurN<br/>echo Continue?<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword required<br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto NO<br/><br/>:YES<br/>start "allinfo"<br/>exit<br/><br/><br/>:no<br/><br/>echo incorrect password....<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword required<br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto next1<br/>goto YES<br/><br/><br/>:next1<br/>echo incorrect password....<br/>pause<br/><br/>cls<br/>echo sensitive information<br/>ECHO pasword required<br/><br/>:password<br/>set input= password =<br/>set/p input=password (input then press enter):<br/>if %input%==willburnyou goto YES<br/>if not %input%==willburn goto next2<br/>goto YES<br/><br/>:next2<br/>echo incorect password<br/><br/>pause<br/><br/><br/>echo you have been terminated<br/>echo This file and all subfoders are now deleted<br/>del allinfo\access.bat<br/>shutdown -s<br/>pause<br/></p></body></html> | |
309. |
Solve : loggin console output of batch to text file without using redirect? |
Answer» <html><body><p>Hi,<br/>Can any one <a href="https://interviewquestions.tuteehub.com/tag/plz-1718368" style="font-weight:bold;" target="_blank" title="Click to know more about PLZ">PLZ</a> help me for the following case:<br/>I want to save 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> console output with out using a redirect ie if we <a href="https://interviewquestions.tuteehub.com/tag/use-241643" style="font-weight:bold;" target="_blank" title="Click to know more about USE">USE</a> redirect command ">" the we have to execte batch in following way:<br/>C:\mybatch.bat >C:\batchlog.txt<br/>I need it to be in same batch file only, so that by only <a href="https://interviewquestions.tuteehub.com/tag/passing-1148520" style="font-weight:bold;" target="_blank" title="Click to know more about PASSING">PASSING</a> argument as -log="path to save batch'c log" that batch execute <br/>as well as simultaneously record its console output in text file.!<br/><br/>Thanks in advance ..!<br/><br/>ArpanBatch code does not support named arguments. However you might tag each command in your batch file with %2 which if <strong>-log=</strong> is present would redirect the output, and if not present, there would be no redirected output:<br/><br/><strong>batchfile.bat</strong><br/> Code: <a>[Select]</a>command1 %2<br/>command2<br/>command3 %2<br/><br/>if you run the batch file as <strong>batchfile -log=">>path to save batch'c log"</strong>, the output from commands 1 and 3 would be redirected. If you run the batch file as <strong>batchfile</strong> with no parameters, then none of the command output would be redirected.<br/><br/> <br/><br/><strong>Note:</strong> This method is not best practice. Readability would be increased if you simply used positional arguments on the command line. Not everyone might recognize that <strong>-log=">>path to save batch'c log" </strong>resolves to two parameters.</p></body></html> | |
310. |
Solve : Batch file/Terminal server help? |
Answer» <html><body><p>Right, apologies i this has been asked, I did search but I am at work and extremely <a href="https://interviewquestions.tuteehub.com/tag/busy-404257" style="font-weight:bold;" target="_blank" title="Click to know more about BUSY">BUSY</a> so didn't get to look completely. I'm also quite new to batch files.<br/><br/><br/>Basically, I am trying to write a batch file to do the following:<br/><br/>1. Open a program (this works)<br/>2. Login to <a href="https://interviewquestions.tuteehub.com/tag/terminal-11506" style="font-weight:bold;" target="_blank" title="Click to know more about TERMINAL">TERMINAL</a> server (this works)<br/>3. Open a program on terminal server<br/>4. Open <a href="https://interviewquestions.tuteehub.com/tag/another-876628" style="font-weight:bold;" target="_blank" title="Click to know more about ANOTHER">ANOTHER</a> program on terminal server<br/><br/>All from one batch file, on the local machine<br/><br/>What is the command to execute a program on a terminal server, from a local machine? I've tried \\tsclient\ "C:\file <a href="https://interviewquestions.tuteehub.com/tag/path-11833" style="font-weight:bold;" target="_blank" title="Click to know more about PATH">PATH</a>", and other variations, but that doesn't work. Is it <a href="https://interviewquestions.tuteehub.com/tag/even-976335" style="font-weight:bold;" target="_blank" title="Click to know more about EVEN">EVEN</a> possible?<br/><br/>Many Thanks!Or ofcourse if that's not possible, is it possible to CALL a batch file on the Terminal server, from the Batch on the local machine?</p></body></html> | |
311. |
Solve : save .dbf file to .csv by opening it..!? |
Answer» <html><body><p>hey folks .<br/>I m new born child in dos n batch programming.<br/>I <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> 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 code in dos commands/batch program, which can <a href="https://interviewquestions.tuteehub.com/tag/open-245076" style="font-weight:bold;" target="_blank" title="Click to know more about OPEN">OPEN</a> a file(.dbf) from my computer and save it in a <a href="https://interviewquestions.tuteehub.com/tag/different-951434" style="font-weight:bold;" target="_blank" title="Click to know more about DIFFERENT">DIFFERENT</a> format(.csv) on my computer.<br/><br/>can u help me ..its a litle urgent ..plz<br/><br/>rgds,<br/>pcA .dbf file could belong to one of many applictions, which is it ?<br/><br/>However, I unless there is a <a href="https://interviewquestions.tuteehub.com/tag/convertor-933340" style="font-weight:bold;" target="_blank" title="Click to know more about CONVERTOR">CONVERTOR</a> application, it is unlikely that you will be able to do this with a batch; vbscript might help you.</p></body></html> | |
312. |
Solve : output files based on two FIND criterias with .bat file.? |
Answer» <html><body><p>I wrote a .bat script that will search a folder for files with file names that were modified on todays date and then output the results to a .txt file. I want to change it to only return files that were not modified on todays date. I tried to use /V in the second FIND statements, but it appears to apply the /V to both FIND statements. <br/><br/> Code: <a>[Select]</a>for /f "tokens=2,3,4 delims=/ " %%a in ('DATE /T') do set date=%%a/%%b/%%c<br/>dir "c:\temp" /s /ta /a-d | find "%test_script.txt% %script_test.txt%" | find "%date%" > c:\temp\list.txt<br/>This is my /V attempt that does not do what I want.<br/> Code: <a>[Select]</a>for /f "tokens=2,3,4 delims=/ " %%a in ('DATE /T') do set date=%%a/%%b/%%c<br/>dir "c:\temp" /s /ta /a-d | find "%test_script.txt% %script_test.txt%" | find "%date%" /V > c:\temp\list.txt<br/><br/>If you know how to modify this script to meet my needs let me know.<br/><br/>Thank youTry puting the /V switch after FIND and before the string. e.g find /v "%date%" <br/><br/>By the way, (1) did you really want to set a variable (%date%) with the same name as a system variable? (2) The /ta switch is time last accessed which is not necessarily the time a file was last modified. Maybe you need /tw (time last written) switch.<br/><br/>Why don't you just use FOR to find the modified date directly? <br/><br/><br/><br/>The /V is in the wrong place in my post. I am using it in directly after the find.<br/><br/>1. I can change the variable name. Nice tip.<br/><br/>2. I should change the /ta to /tw.<br/><br/>I do not know how to use FOR to find the date directly. Feel free to modify what I have and help me out.<br/><br/>Thank you for your help.I will have a try with some ideas I have... could you do one thing for me?<br/><br/>Open a command prompt and type <br/><br/>echo %date%<br/><br/>and copy and paste here what you <a href="https://interviewquestions.tuteehub.com/tag/get-11812" style="font-weight:bold;" target="_blank" title="Click to know more about GET">GET</a>?<br/><br/>I need to see your local date format<br/><br/>Thu 10/28/2010<br/><br/>That is the date format. <br/><br/>The first line of my script returns "10/28/2010".<br/><br/><br/>Thank you for your help.What sort of output do you get from this?<br/><br/><br/> Code: <a>[Select]</a><br/>echo off<br/>for /f "delims=" %%A in ('dir /s /b /tw c:\temp') do (<br/> echo %%~tA %%~dpnxA<br/> )<br/><br/>I have 3 test files. Your script returns all of them. These are the only three files in c:\temp.<br/><br/><br/>10/28/2010 10:20 PM c:\temp\test_1.txt<br/>10/28/2010 10:21 PM c:\temp\test_2.txt<br/>10/11/2010 02:18 PM c:\temp\Test_3.txt<br/>Microsoft Windows [Version 6.1.7600]<br/>Copyright (c) 2009 Microsoft Corporation. All rights reserved.<br/>try this<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>set TodayDate=%date%<br/>echo Today is %TodayDate%<br/><br/>REM create at least one file with todays date for test<br/>echo hello>c:\temp\TodaysFile.txt<br/><br/>for /f "delims=" %%A in ('dir /s /b /tw /a-d c:\temp') do (<br/> set FileDateTime=%%~tA<br/> set FileDrivePathnameExt=%%~dpnxA<br/> for /f "tokens=1-2 delims= " %%D in ("!FileDateTime!") do set DatePart=%%D<br/> if "!DatePart!"=="%TodayDate%" (<br/> echo Keep !FileDrivePathnameExt!<br/> ) else (<br/> echo Remove !FileDrivePathNameExt!<br/> REM IN next line remove REM to actually remove the file<br/> REM <a href="https://interviewquestions.tuteehub.com/tag/del-947443" style="font-weight:bold;" target="_blank" title="Click to know more about DEL">DEL</a> "!FileDrivePathnameExt"<br/> )<br/> )<br/> As you wrote it, it returns all files. I think the problem is the TodayDate string. I modified it to use my date string and now it tells me which files to keep.<br/><br/>I do not want to remove any files as they are already overwritten daily. I just need a quick check to tell me which files were not <a href="https://interviewquestions.tuteehub.com/tag/updatedbrbr-3249372" style="font-weight:bold;" target="_blank" title="Click to know more about UPDATED">UPDATED</a> today, indication of an error. I want to search for them by name as I did in my script. <br/><br/>The folders will have other files that I want to exclude from the scope of this script, so I must search for them by name, and identify which ones I named in the FIND do not have a modified date of today. I think what you have is really close though.<br/><br/><br/><br/>(Update) I realised that you want to output a list of files modified before today's date to a text file.<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>set TodayDate=%date%<br/>if exist output.txt del output.txt<br/>echo Files modified before date: %TodayDate%>output.txt<br/>echo.>>output.txt<br/>set filesfound=0<br/>for /f "delims=" %%A in ('dir /s /b /tw /a-d c:\temp') do (<br/> set FileDateTime=%%~tA<br/> set FileDrivePathnameExt=%%~dpnxA<br/> for /f "tokens=1-2 delims= " %%D in ("!FileDateTime!") do set DatePart=%%D<br/> if not "!DatePart!"=="%TodayDate%" (<br/> echo Modified: !DatePart! File: "!FileDrivePathnameExt">>output.txt<br/> set /a filesfound+=1<br/> )<br/> )<br/>echo Files found: %filesfound%<br/><br/> The output your latest version returns is below. The only thing I need is to only apply the search to the named files like I was doing in my script. And output the filename and date modified. This is almost what I need.<br/><br/>Thank you for your help so far.<br/><br/><br/><br/>Files modified before date: Fri 10/29/2010<br/><br/>Modified: 10/25/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/22/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/25/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/25/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/29/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/28/2010 File: "FileDrivePathnameExt"<br/>Modified: 10/25/2010 File: "FileDrivePathnameExt"<br/><br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/>set TodayDate=%date%<br/>if exist output.txt del output.txt<br/>echo Files modified before date: %TodayDate%>output.txt<br/>echo.>>output.txt<br/>set filesfound=0<br/>for /f "delims=" %%A in ('dir /s /b /tw /a-d c:\temp ^| find "%test_script.txt% %script_test.txt%" ') do (<br/> set FileDateTime=%%~tA<br/> set FileDrivePathnameExt=%%~dpnxA<br/> for /f "tokens=1-2 delims= " %%D in ("!FileDateTime!") do set DatePart=%%D<br/> if not "!DatePart!"=="%TodayDate%" (<br/> REM this was an error<br/> REM Replaced exclamation mark at the end of !FileDrivePathnameExt!<br/> echo Modified: !DatePart! File: "!FileDrivePathnameExt!">>output.txt<br/> set /a filesfound+=1<br/> )<br/> )<br/>echo Files found: %filesfound%that does not return anything. i have 3 test files. one has a modified date of "10/29/2010". Could it be that your date string reads Fri 10/29/2010.<br/><br/>thank you for your continued help. Quote</p><blockquote>"%test_script.txt% %script_test.txt%" </blockquote> <br/>What do these variables hold?<br/><br/>Those are file names. I need to check just the file names I include in those strings for modified dates <> today and return them.<br/><br/>In my test c:\temp folder I have three files<br/><br/>script_test.txt modified: 10/28/2010<br/>test_script.txt modified: 10/29/2010<br/>not_included.txt does not matter because it is not named in the script.<br/><br/>The goal would be to return: <br/>script_test.txt 10/28/2010<br/><br/>This would tell me quickly that this file was not updated so I could troubleshoot the process responsible for updating that file. I have to check a ton of folders each morning. My ultimate goal is the clean up the process, but in the meantime I need this to take less of my <a href="https://interviewquestions.tuteehub.com/tag/day-244454" style="font-weight:bold;" target="_blank" title="Click to know more about DAY">DAY</a>. New jobs have their quirks.<br/><br/>Thank you.</body></html> | |
313. |
Solve : How to install a software autiomatically by using batch file? |
Answer» <html><body><p>Hi all,<br/><br/> <a href="https://interviewquestions.tuteehub.com/tag/daily-245095" style="font-weight:bold;" target="_blank" title="Click to know more about DAILY">DAILY</a> i am installing many softwares in my system, everytime while installing i need to give "Next, Next, I agree buttons", So i <a href="https://interviewquestions.tuteehub.com/tag/don-t-246903" style="font-weight:bold;" target="_blank" title="Click to know more about DONT">DONT</a> want to do everytime, Hence i need a software or 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> to schedule the <a href="https://interviewquestions.tuteehub.com/tag/install-2121155" style="font-weight:bold;" target="_blank" title="Click to know more about INSTALL">INSTALL</a> autiomatically. Can any one <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a>?You might try running the installer from the command line and using the <strong>/?</strong> switch. This may display some help for running an unattended install. <br/><br/>An alternative would be a VBScript where you could send keystrokes to the installer program. This would take some planning so the keystrokes are timed properly and are in the proper sequence.<br/><br/>Good luck.</p></body></html> | |
314. |
Solve : how do I delete a primary partition both C: and D: are primary??? |
Answer» <html><body><p>I want to delete the D: Partition and expand the C: partition, but the OS says no, how do I tackle the problem or what DOS command do I use to delete D:??<br/>What is on your D: partition?<br/><br/>If its your recovery drive, i would not advise it.What partition is the OS on (and page file) ?<br/><br/>Make <a href="https://interviewquestions.tuteehub.com/tag/sure-656539" style="font-weight:bold;" target="_blank" title="Click to know more about SURE">SURE</a> you have full admin rights.<br/><br/>After moving off or backing up all the data you want from the other drive you will be removing, try use 'Disk Management'.<br/><br/>Under Control Panel > Administrative Tools > Computer Management<br/><br/>On the left side bar you have: <br/>Storage > Disk Management<br/><br/>You should see <a href="https://interviewquestions.tuteehub.com/tag/volumes-1448111" style="font-weight:bold;" target="_blank" title="Click to know more about VOLUMES">VOLUMES</a> C:\ and D:\<br/>Status will tell you System, <a href="https://interviewquestions.tuteehub.com/tag/boot-251147" style="font-weight:bold;" target="_blank" title="Click to know more about BOOT">BOOT</a>, Active, Partition, Page File, etc. <br/>Note - make sure you don't try remove the primary partition with boot, system and page file.<br/><br/>You should be able to delete the other volume and then extend the primary partition to claim back the free space.<br/>Azzaboi<br/><br/>Lets hope thet dont follow your advice and delete the recovery partition. <br/><br/>You should gather more infromation before throwing 'advice' into the wind and hoping for the best. Sometimes telling the OP what they ask for straight away does not necessarily help them. Occasionally they dont know why or what they are asking!<br/><br/>no offence pwb67220reddevilggg -<br/><br/>You already previous meationed the possible "recovery partition",<br/>and I said "After moving off or backing up all the data you want from the other drive you will be removing",<br/>as well as "Note - make sure you don't try remove the primary partition with boot, system and page file."<br/><br/>Shrugs, sorry but I won't treat any user as a complete noobie - that's already Vista's job, lol.<br/><br/> Quote from: Azzaboi on October 30, <a href="https://interviewquestions.tuteehub.com/tag/2010-290294" style="font-weight:bold;" target="_blank" title="Click to know more about 2010">2010</a>, 10:23:43 PM</p><blockquote>Shrugs, sorry but I won't treat any user as a complete noobie - that's already Vista's job, lol.<br/></blockquote> <br/>Even <a href="https://interviewquestions.tuteehub.com/tag/though-1417450" style="font-weight:bold;" target="_blank" title="Click to know more about THOUGH">THOUGH</a> they have listed their experience as beginner, well done. Which indicates that they might not even know what a recovery drive is or does. <br/><br/>Your so quick to give advice and not so good at taking it. You can do more harm than good. ( Suppose its all part of growing up)</body></html> | |
315. |
Solve : Old files deletion? |
Answer» <html><body><p>Hi all,<br/><br/> Im looking for a batch script which will delete older than 7 days file. i have script which will copy some files into the <a href="https://interviewquestions.tuteehub.com/tag/folder-246959" style="font-weight:bold;" target="_blank" title="Click to know more about FOLDER">FOLDER</a> in .yyyddmm format. <br/><br/> Everyday folder size will grow - To avoid <a href="https://interviewquestions.tuteehub.com/tag/free-240724" style="font-weight:bold;" target="_blank" title="Click to know more about FREE">FREE</a> space issue, need a script which will <a href="https://interviewquestions.tuteehub.com/tag/keep-527902" style="font-weight:bold;" target="_blank" title="Click to know more about KEEP">KEEP</a> last 7 days files and the older files need to be deleted permanently.<br/><br/>Please help me on this<br/><br/>Regards<br/>Paulwintech<br/><br/>Copy and paste the batch file given in the first <a href="https://interviewquestions.tuteehub.com/tag/post-2638" style="font-weight:bold;" target="_blank" title="Click to know more about POST">POST</a> of the link and save it.<br/><br/><a href="http://www.computing.net/answers/programming/delete-files-older-then-xdays/15229.html">http://www.computing.net/answers/programming/delete-files-older-then-xdays/15229.html</a><br/><br/>Now you can read this part of the batch file for help:<br/><br/> Code: <a>[Select]</a>:SYNTAX<br/>Echo.<br/>Echo <a href="https://interviewquestions.tuteehub.com/tag/usage-25676" style="font-weight:bold;" target="_blank" title="Click to know more about USAGE">USAGE</a>:<br/>Echo Delete-Files.bat [Days] [Dir] [File-Extension] [Sub-Directory Search] [Read_Only_Delete]<br/>Echo Delete-Files x C:\ wildcard.ext 0 or 1 0 or 1<br/>Echo.<br/>Echo Mandatory: "Delete-Files [Days] [Dir] [File-Extension]"<br/>Echo "Delete-Files 180 C:\Temp *.Log"<br/>Echo.<br/>Echo Where:<br/>Echo [Days] = Number <br/>Echo Determines the number of days previous to Today that will be selected.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 5 C:\Temp *.LOG" Deletes all LOG files older than 5 days.<br/>Echo.<br/>Echo [Dir] = Path<br/>Echo "Delete-Files.bat 120 C:\Temp *.LOG" Deletes all LOG files from the <br/>Echo "C:\Temp" directory that are older than 120 days.<br/>Echo.<br/>Echo [File-Extension] = wildcards and extension<br/>Echo This detemined which files or file-types that will be deleted.<br/>Echo.<br/>Echo Wildcards are allowed. [* ?]<br/>Echo Examples: [*.* , *.LOG , ~*.*]<br/>Echo.<br/>Echo Example: "Delete-Files.bat 15 C:\Temp *.LOG"<br/>Echo Example: This will delete all LOG files older than 15 days from C:\Temp<br/>Echo.<br/>Echo [Sub-Directory Search] = 1 or 0<br/>Echo.<br/>Echo Possible values {0 , 1}<br/>Echo A value of "0" or blank, will not search sub-directory for possible files<br/>Echo to delete.<br/>Echo.<br/>Echo A value of "1" and only "1", will search every directory underneath the<br/>Echo the specified directory. If C:\Temp and "1" then C:\Temp and C:\Temp\srbackup\..<br/>Echo will be searched and evaluated for file deletion.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 5 C:\Temp *.LOG 1"<br/>Echo This will search C:\Temp and ALL sub-directories for *.LOG files, older<br/>Echo then 5 days and delete them.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 5 C:\Temp *.LOG"<br/>Echo This will search ONLY C:\Temp for *.LOG files older than 5 days and <br/>Echo delete those that qualify.<br/>Echo.<br/>Echo [Read_Only_Delete] = 1 or 0<br/>Echo WARNING!<br/>Echo The Sub-Directory Search value must be present for this to work.<br/>Echo.<br/>Echo This fifth control-switch will force the deletion of Read-Only files.<br/>Echo Enter a "1" if the forced deletion of Read-Only files is wanted.<br/>Echo Leave the value empty or specify "0" to keep Read-Only untouched.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 120 C:\Temp *.LOG 0 1"<br/>Echo This will delete all LOG files, over 120 days, in C:\Temp, and will <br/>Echo be deleted even if Read-Only. This switch will delete regular and Read-Only files.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 120 C:\Temp *.LOG 0 0"<br/>Echo This will delete all LOG files, over 120 days, in C:\Temp, and <br/>Echo will NOT delete Read-Only files.<br/>Echo.<br/>Echo Example: "Delete-Files.bat 120 C:\Temp *.LOG 1 1"<br/>Echo This will delete all LOG files, over 120 days, in C:\Temp, in all subdirectories of C:\Temp<br/>Echo and will delete files Read-Only and regular.<br/>Echo.<br/>--------------------<br/>Echo Delete-Files.bat [Days] [Dir] [File-Extension] [Sub-Directory Search] [Read_Only_Delete]<br/>Echo Delete-Files x C:\ wildcard.ext 0 or 1 0 or 1<br/>Echo.<br/>Echo Mandatory: "Delete-Files [Days] [Dir] [File-Extension]"<br/>Echo "Delete-Files 180 C:\Temp *.Log"<br/>Echo.<br/>Echo -- End of help --<br/></p></body></html> | |
316. |
Solve : How to prompt for a string and upshift the input.? |
Answer» <html><body><p>Anyone know how to prompt for a value and upshift the <a href="https://interviewquestions.tuteehub.com/tag/input-11237" style="font-weight:bold;" target="_blank" title="Click to know more about INPUT">INPUT</a>?<br/><br/>I need a table name before calling SQL Plus and it has to be in upper case.<br/><br/>ThanksFound this in the snippet closet. <a href="https://interviewquestions.tuteehub.com/tag/knew-2148414" style="font-weight:bold;" target="_blank" title="Click to know more about KNEW">KNEW</a> it would be needed someday. You'll need to tweak this for your needs, but this will convert a string entered at the prompt to UPPERCASE:<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>setlocal enabledelayedexpansion<br/><br/>set /p <a href="https://interviewquestions.tuteehub.com/tag/db-344411" style="font-weight:bold;" target="_blank" title="Click to know more about DB">DB</a>=Enter Database Name: <br/><br/>set u=ABCDEFGHIJKLMNOPQRSTUVWXYZ<br/>set <a href="https://interviewquestions.tuteehub.com/tag/l-236827" style="font-weight:bold;" target="_blank" title="Click to know more about L">L</a>=abcdefghijklmnopqrstuvwxyz <br/><br/>set database=%db%<br/>for /l %%b in (0,1,25) do call :u !l:~%%b,1! !u:~%%b,1!<br/>echo "%db%" has been converted to "!database!"<br/><a href="https://interviewquestions.tuteehub.com/tag/goto-1009988" style="font-weight:bold;" target="_blank" title="Click to know more about GOTO">GOTO</a> :eof<br/><br/>:u<br/> set "database=!database:%1=%2!"<br/> goto :eof<br/><br/>Good luck.</p></body></html> | |
317. |
Solve : Making Multiple folder(s) with batch File? |
Answer» <html><body><p>Hello Everyone, I <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> like some help making a 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> as a side project for modding games,<br/>I would like the batch file to make multiple folder(s) with it's file name of my choice.<br/>But will make <a href="https://interviewquestions.tuteehub.com/tag/folders-994110" style="font-weight:bold;" target="_blank" title="Click to know more about FOLDERS">FOLDERS</a> in this style Eg.<br/>My folder(1)<br/>My folder(1)<br/>My folder(1)<br/>My folder(1)<br/><br/>The numeric value changing every new folder or coped folder<br/>there is a long way of doing this but i <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> a lot of folders<br/><br/>echo on<br/>mkdir Fallout3Mod #(NUMBER) <<< maby a %andom% on the end of the file name???<br/>copy Fallout3Mod # (Same Dir, new numeric value)<br/>Batch.batYou <a href="https://interviewquestions.tuteehub.com/tag/want-1448756" style="font-weight:bold;" target="_blank" title="Click to know more about WANT">WANT</a> to use FOR /L ... do <br/>for /? <br/>at the command prompt to see how it works</p></body></html> | |
318. |
Solve : Syntax problem with the FOR command? |
Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/hi-479908" style="font-weight:bold;" target="_blank" title="Click to know more about HI">HI</a>,<br/><br/>I'm trying to extract File extensions (8.3) from a text file but I can't get it to work, any ideas? Here is the code i'm trying to use:<br/><br/> DIR "C:\test\datafile.*" /b > C:\data.lst"<br/> <br/> FOR /F "eol= " %%i IN (C:\data.lst) DO (<br/> SET FileExt=%%i:~<a href="https://interviewquestions.tuteehub.com/tag/9-miliyn-237742" style="font-weight:bold;" target="_blank" title="Click to know more about 9">9</a>%<br/> ECHO %FileExt%<br/> )<br/><br/><br/>The contents of "C:\data.lst" looks like:<br/><br/> datafile.1<br/> datafile.7<br/> datafile.25<br/> datafile.98<br/> datafile.167<br/> datafile.817<br/><br/><br/>ThanksI figured it out, I <a href="https://interviewquestions.tuteehub.com/tag/needed-1112853" style="font-weight:bold;" target="_blank" title="Click to know more about NEEDED">NEEDED</a> to use the <a href="https://interviewquestions.tuteehub.com/tag/setlocal" style="font-weight:bold;" target="_blank" title="Click to know more about SETLOCAL">SETLOCAL</a> command and instead of using % I needed to use !. This is the syntax I'm using:<br/><br/> DIR "C:\test\datafile.*" /b > "C:\data.lst"<br/> <br/> SetLocal EnableDelayedExpansion<br/> FOR /F "eol= " %%i IN (C:\data.lst) DO (<br/> SET DataFile=%%i<br/> SET FileExt=!DataFile:~9!<br/> ECHO !FileExt!<br/> )<br/> EndLocal<br/><br/>If anyone has any better ideas to do this, I'm all ears!!set fileExt=%%~xi<br/><br/>type FOR /? at the prompt for full help<br/></body></html> | |
319. |
Solve : i need help with batch files?? |
Answer» <html><body><br/>how do i <a href="https://interviewquestions.tuteehub.com/tag/create-427332" style="font-weight:bold;" target="_blank" title="Click to know more about CREATE">CREATE</a> 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 which will create a folder at the <a href="https://interviewquestions.tuteehub.com/tag/root-237331" style="font-weight:bold;" target="_blank" title="Click to know more about ROOT">ROOT</a> of the <a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a> drive? More <a href="https://interviewquestions.tuteehub.com/tag/homework-1028715" style="font-weight:bold;" target="_blank" title="Click to know more about HOMEWORK">HOMEWORK</a>?yesSorry. As I told you in the other threads, we don't do homework.</body></html> | |
320. |
Solve : OR operator? |
Answer» <html><body><p>I've searched a lot for this but I can't find the answer. What I want to do is the following (doesn't work otherwise I wouldn't have opened a new topic )<br/><br/> Code: <a>[Select]</a>IF "%1" == "help" OR "%1" == "--help" OR "%1" == "-help" (<br/>ECHO:HELP FILE<br/>GOTO :EOF<br/>)<br/>If this is something mentioned, please point me to that topic. Thanks in advance.I am presuming you mean NT/W2K/XP/Vista/W7 cmd.exe - there is no OR operator in batch language, so you have to build the test manually. Here is an example:<br/><br/> Code: <a>[Select]</a>set bool=0<br/>IF "%1"=="help" set /a bool+=1<br/>IF "%1"=="--help" set /a bool+=1<br/>IF "%1"=="-help" set /a bool+=1<br/><br/>IF %bool% GTR 0 (<br/> ECHO:HELP FILE<br/> GOTO :EOF<br/>)<br/><br/><br/>alternative format for incrementing %bool%<br/><br/> Code: <a>[Select]</a>set /a bool=%bool%+1This is exactly what I was looking for! <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, it makes a lot of sense the way you do it That code above will work with "help" or "--help" or "-help" but would fail with HELP or --HELP or -HELP so if you want the string tests to be case insensitive use IF with the /I (or /i) switch<br/><br/><br/> Code: <a>[Select]</a>set bool=0<br/>IF /I "%1"=="help" set /a bool+=1<br/>IF /I "%1"=="--help" set /a bool+=1<br/>IF /I "%1"=="-help" set /a bool+=1<br/><br/>IF %bool% GTR 0 (<br/> ECHO:HELP FILE<br/> GOTO :EOF<br/>)<br/>Yep, I know I already use the /I switch. An alternative OR implemetation<br/><br/> Code: <a>[Select]</a>IF /I "%1"=="help" goto help<br/>IF /I "%1"=="--help" goto help<br/>IF /I "%1"=="-help" goto help<br/><br/>REM not asking for help<br/>REM main code here<br/>goto end<br/><br/>:help<br/>echo Usage syntax<br/>echo bla bla bla<br/><br/>:end<br/>REM end of script<br/><br/>Thanks for the help, both ways work perfectly. <br/><br/>Now a small problem I've come across:<br/><br/> Code: <a>[Select]</a>ECHO OFF<br/>CALL :SUBMESSAGE "first argument" "second argument"<br/>PAUSE<br/>GOTO :EOF<br/><br/>:MSG<br/>ECHO. && ECHO:______________________________<br/>IF /I %~2=="" (<br/> SET %2=Failed!<br/>)<br/>ECHO:[%~1] %~2<br/>ECHO:______________________________ && ECHO.<br/>IF /I %1=="error" (<br/> PAUSE<br/> EXIT<br/>)<br/><br/>GOTO :EOF<br/>I cannot get it work if I specify only one argument... It's related to quotes but it's still driving me crazy <br/><br/>Thank you in advance.I'm not surprised you can't get it to work...<br/><br/> Code: <a>[Select]</a>CALL :SUBMESSAGE "first argument" "second argument"<br/>Where is the :SUBMESSAGE label?<br/><br/> Code: <a>[Select]</a>IF /I %~2==""<br/>Since %~2 is the %2 parameter <em>without</em> (any) <a href="https://interviewquestions.tuteehub.com/tag/surrounding-1235953" style="font-weight:bold;" target="_blank" title="Click to know more about SURROUNDING">SURROUNDING</a> quotes, this equality will never be satisfied.<br/><br/> Code: <a>[Select]</a>SET %2=Failed!<br/>I don't know what you think this is going to do...<br/><br/><br/><br/><br/>:MSG = :SUBMESSAGE, just a typo <br/><br/>I simply want to use a <a href="https://interviewquestions.tuteehub.com/tag/subroutine-251507" style="font-weight:bold;" target="_blank" title="Click to know more about SUBROUTINE">SUBROUTINE</a> to display some messages based on the input. But the input arguments will always have quotes.<br/><br/> Code: <a>[Select]</a>ECHO OFF<br/>CALL :SUBMESSAGE "first argument" "second argument"<br/>PAUSE<br/>GOTO :EOF<br/><br/>:MSG<br/>ECHO. && ECHO:______________________________<br/>IF /I %~2=="" (<br/> SET %2=Failed!<br/>)<br/>ECHO:[%~1] %~2<br/>ECHO:______________________________ && ECHO.<br/>IF /I %1=="error" (<br/> PAUSE<br/> EXIT<br/>)<br/><br/>GOTO :EOFDid you even read my <a href="https://interviewquestions.tuteehub.com/tag/post-2638" style="font-weight:bold;" target="_blank" title="Click to know more about POST">POST</a>?<br/>Of course I did. Well a solution would be to always use quotes and always specify %2.<br/>Anyway, thanks. Quote from: Chem4 on November 09, 2010, 03:16:21 AM</p><blockquote>Of course I did. Well a solution would be to always use quotes and always specify %2.<br/>Anyway, thanks.<br/></blockquote> <br/>if you want to know if %2 is <a href="https://interviewquestions.tuteehub.com/tag/null-17167" style="font-weight:bold;" target="_blank" title="Click to know more about NULL">NULL</a> (blank) then you need to do <br/><br/>if "%~2"=="" then [whatever]<br/><br/>or<br/><br/>if {%~2}=={} then [whatever]<br/><br/>or you can use any non-control character as the prefix and suffix.<br/><br/><br/><br/><br/><br/>Unlike some programming languages this "" is not an empty string in batch. It is a string of length 2 characters.<br/><br/>And you cannot do this<br/><br/>SET %2=Failed!<br/><br/></body></html> | |
321. |
Solve : Using the Path in Windows 7 doesn't like (x86)? |
Answer» <html><body><p>Can someone tell me how to add something to the path in a <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 (x64) that <a href="https://interviewquestions.tuteehub.com/tag/contains-11473" style="font-weight:bold;" target="_blank" title="Click to know more about CONTAINS">CONTAINS</a> (x86).<br/>It craps out and I cannot find a command to change the contents to 16 bit versions.Here is some more information.<br/>I need to add the Oracle_home variable to the users path and then take it away once they leve the application.<br/>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> is the existing PATH has "Program <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a> (x86)" in it...and the '(' are causing an error.<br/><br/>REM Setup path for Oracle<br/>if {%DATABASE%}=={ORACLE} (<br/> set OLDPATH=%PATH%<br/> set PATH=%ORACLE_HOME%\bin;%PATH%<br/>)<br/><br/>Well I found the solution on another site.<br/>For all those who are going to have the same problem here it is.<br/><br/>Add <a href="https://interviewquestions.tuteehub.com/tag/quotes-1175233" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTES">QUOTES</a> around the PATH=... statement.<br/><br/>REM Setup path for Oracle<br/>if {%DATABASE%}=={ORACLE} (<br/> set "OLDPATH=%PATH%"<br/> set "PATH=%ORACLE_HOME%\bin;%PATH%"<br/>)<br/><br/>Well done!<br/></p></body></html> | |
322. |
Solve : lpr command? |
Answer» <html><body><p>Hello, <br/><br/>I do not have very much <a href="https://interviewquestions.tuteehub.com/tag/knowledge-25694" style="font-weight:bold;" target="_blank" title="Click to know more about KNOWLEDGE">KNOWLEDGE</a> about DOS, but I have been reading. I am trying to use the lpr command to print a pdf document, but is there a <a href="https://interviewquestions.tuteehub.com/tag/way-246442" style="font-weight:bold;" target="_blank" title="Click to know more about WAY">WAY</a> I could incorporate the lpr command in my webpage so when the user clicks print it will execute that command? Or do you have a better recommendation to use the lpr command with a more user friendly than command prompt?<br/>Do you <a href="https://interviewquestions.tuteehub.com/tag/want-1448756" style="font-weight:bold;" target="_blank" title="Click to know more about WANT">WANT</a> a visitor to go to a web <a href="https://interviewquestions.tuteehub.com/tag/page-25452" style="font-weight:bold;" target="_blank" title="Click to know more about PAGE">PAGE</a> and print that page?<br/>If so, you can not just use a DOS command. You don't know what OS he has. Maybe he is using an <a href="https://interviewquestions.tuteehub.com/tag/apple-kaa-mukhly-380598" style="font-weight:bold;" target="_blank" title="Click to know more about APPLE">APPLE</a>, not DOS.<br/>In JavaScript you can print a page.<br/><a href="http://www.htmlgoodies.com/beyond/javascript/article.php/3471121/Print-a-Web-Page-Using-JavaScript.htm">Print a Web Page Using JavaScript</a><br/>Of course, that is not for a PDF file.</p></body></html> | |
323. |
Solve : How to compare 2 text files in a script?? |
Answer» <html><body><p>Hello<br/><br/>I have to write a script that downloads a small text file from our mainframe daily. If the file has the same contents as in the file downloaded the day before then the script exits but if the files have different contents then I have to append the contents to another file among other things that are not <a href="https://interviewquestions.tuteehub.com/tag/relevant-613818" style="font-weight:bold;" target="_blank" title="Click to know more about RELEVANT">RELEVANT</a>. The only challenge I have is the comparison of files as you may suspect. I have tried a couple of things but without success. I tried this:<br/><br/>FC c:\Download\TodayFile.txt c:\Yesterday\File.txt \L > <a href="https://interviewquestions.tuteehub.com/tag/diff-431920" style="font-weight:bold;" target="_blank" title="Click to know more about DIFF">DIFF</a><br/>Copy diff compareIt > Nul<br/>If not exist compareIt GOTO SAME_FILE_TODAY<br/><br/>I also used command COMP. <br/><br/>I'd love to find a solution that is within DOS. <br/><br/>Any help is welcome.<br/><br/>Thanks<br/><br/>p.s. Please reply to this post or email me directly.<br/><br/><br/><br/><br/><br/> Code: <a>[Select]</a>FC c:\Download\TodayFile.txt c:\Yesterday\File.txt /L | FIND "FC: no dif" > nul <br/> IF ERRORLEVEL 1 goto different<br/>echo Files are the same.<br/>goto end<br/>:different<br/>echo Files are different.<br/>:end<br/>basically, we cheat and use FIND to search through the results of FC, since to my understanding FC doesn't return an errorlevel.Yep, <a href="https://interviewquestions.tuteehub.com/tag/noticed-2877256" style="font-weight:bold;" target="_blank" title="Click to know more about NOTICED">NOTICED</a> that too. I will give it a <a href="https://interviewquestions.tuteehub.com/tag/try-1428546" style="font-weight:bold;" target="_blank" title="Click to know more about TRY">TRY</a>. I am <a href="https://interviewquestions.tuteehub.com/tag/sure-656539" style="font-weight:bold;" target="_blank" title="Click to know more about SURE">SURE</a> it will work.<br/><br/>Thank you Quote from: DosStud on November 03, 2010, 05:58:41 PM</p><blockquote>Yep, noticed that too. I will give it a try. I am sure it will work.<br/><br/>By taking a ride on your suggestion I decided to use it this way...<br/><br/>FC c:\Download\TodayFile.txt c:\Yesterday\File.txt /L | FIND "FC: no dif" > diff<br/>COPY Diff Nul > Nul<br/>IF ERRORLEVEL 1 goto ....<br/><br/>It would be straightforward if FC returned errorlevel<br/><br/>Thank you very much<br/></blockquote> Quote from: BC_Programmer on November 03, 2010, 05:46:46 PM<blockquote>to my understanding FC doesn't return an errorlevel.<br/></blockquote> <br/>That's odd because I thought it returned 0 if the files are the same, 1 if they are different, and 2 if one or both files do not exist.<br/><br/> Code: <a>[Select]</a>echo off<br/>echo hello > test1.txt<br/>copy test1.txt test2.txt>nul<br/>echo goodbye > test3.txt<br/>fc test1.txt test2.txt>nul<br/>echo Compare 2 identical files errorlevel=%errorlevel%<br/>fc test1.txt test3.txt>nul<br/>echo Compare 2 different files errorlevel=%errorlevel%<br/>fc test1.txt test4.txt 2>1>nul<br/>echo compare file with nonexistent file errorlevel=%errorlevel%<br/>fc test5.txt test4.txt 2>1>nul<br/>echo compare two nonexistent files errorlevel=%errorlevel%<br/><br/> Code: <a>[Select]</a>Compare 2 identical files errorlevel=0<br/>Compare 2 different files errorlevel=1<br/>compare file with nonexistent file errorlevel=2<br/>compare two nonexistent files errorlevel=2<br/>Identical output on Windows XP Professional 32 bit SP3 and Windows 7 64 bit Professional. Am I being dumb here and missing something?<br/><br/><br/><br/>cool, that should make the script even shorter then; just a quick errorlevel check in the original script presented by the OP would have done the trick. For some reason I didn't even check if fc actually returned errorlevels. But you know what they say, assuming makes an *censored* out of u and some guy named ming, guess that's what I did.</body></html> | |
324. |
Solve : MKDIR: Access is Denied But Can Create Folder via Windows? |
Answer» <html><body><p>Hi <br/><br/>First Post..new to MSDos<br/><br/>I'm trying to create a new folder using the mkdir command but get the message "Access Is Denied". There is no folder with the same name and I can create the folder if I go in via Windows Explorer. Same user<br/><br/>I'm trying to install the JAVA djk for a new course I'm starting. I also need to unpack a zip file into the new folder (which I cannot create via dos but created via explorer).<br/><br/>I go back into dos and try to unpack the zip file (src.zip) into the new folder (src) (as dictated in the book i'm using) and I get:<br/><br/>java.io.IOexception: com: <a href="https://interviewquestions.tuteehub.com/tag/could-410026" style="font-weight:bold;" target="_blank" title="Click to know more about COULD">COULD</a> not create directory<br/> at sun.tools.jar.Main.extractFile<br/> at sun.tools.jar.Main.extract<br/> at sun.tools.jar.Main.run<br/> at sun.tools.jar.Main.main<br/><br/>I'm guessing it something to do with same problem I can't use the mkdir command<br/><br/>Also: IS THERE A WAY I CAN COPY AND <a href="https://interviewquestions.tuteehub.com/tag/paste-597094" style="font-weight:bold;" target="_blank" title="Click to know more about PASTE">PASTE</a> THE DOS SCRIPT!!!!!!? Typing it could take me a while! <br/><br/>Thanks<br/>Steve1.<br/>Please specify your O.S.<br/>Windows 7 etc. and Windows 95 are quite different.<br/><br/>2.<br/>When you reply, above the Post/Preview etc buttons is Additional Options which allows you to <a href="https://interviewquestions.tuteehub.com/tag/attach-2449108" style="font-weight:bold;" target="_blank" title="Click to know more about ATTACH">ATTACH</a> a file.<br/><br/>Alan<br/>Hi Alan_Br<br/><br/>I'm using W7<br/><br/>How do I save the file..I can see only select all which would allow me to paste somewhere. I that what you meant?<br/><br/>Thanks<br/>SteveI cannot see "Select All" unless I right <a href="https://interviewquestions.tuteehub.com/tag/click-918865" style="font-weight:bold;" target="_blank" title="Click to know more about CLICK">CLICK</a> for context menu options.<br/>You are doing something wrong.<br/><br/>Click on Additional Options, click on Browse, then a small "file manager" will allow you to choose what to attach.<br/><br/>See my sshot-199.gif<br/><br/>Alan<br/><br/><br/>[recovering disk <a href="https://interviewquestions.tuteehub.com/tag/space-239477" style="font-weight:bold;" target="_blank" title="Click to know more about SPACE">SPACE</a> - old attachment deleted by admin]</p></body></html> | |
325. |
Solve : MS DOS Memory Stick Boot Up? |
Answer» <html><body><p>Hey I Have A Problem Which has probably wasted about 8 hours of my time, im not sure if <a href="https://interviewquestions.tuteehub.com/tag/anyone-380251" style="font-weight:bold;" target="_blank" title="Click to know more about ANYONE">ANYONE</a> throughout the ms dos forum know how how to boot ms dos through a memory stick please can you help <a href="https://interviewquestions.tuteehub.com/tag/ive-501760" style="font-weight:bold;" target="_blank" title="Click to know more about IVE">IVE</a> been trying forever to get it to <a href="https://interviewquestions.tuteehub.com/tag/work-20377" style="font-weight:bold;" target="_blank" title="Click to know more about WORK">WORK</a><br/><br/>ive tried creating a virtual floppy and formatting a dos start up but even if i try running the exe just to see what happens it loads cmd and closes straight away with a wrong version error, ive tried alsorts of methods but they just leave me with the blank screen with the cursor ticking, can anyone help?<br/><br/>im running windows 7 and tried using a 4gb stick and 2x 2gb sticks<br/><br/>kadejddescribe the method you have used in (much) more detail<br/>I am running a virtual machine (<a href="https://interviewquestions.tuteehub.com/tag/vmware-723903" style="font-weight:bold;" target="_blank" title="Click to know more about VMWARE">VMWARE</a>) on my work computer, but have been wondering if it would be possible to run DOS on a WindowsXP computer (home, no vmware) from a memory stick. Any help much appreciated!I <a href="https://interviewquestions.tuteehub.com/tag/presume-605485" style="font-weight:bold;" target="_blank" title="Click to know more about PRESUME">PRESUME</a> you mean MS-DOS? Do you have a set of Microsoft floppy disks? <br/><br/></p></body></html> | |
326. |
Solve : DOS Output? |
Answer» <html><body><p>Is there a way to simultaneously <a href="https://interviewquestions.tuteehub.com/tag/redirect-11579" style="font-weight:bold;" target="_blank" title="Click to know more about REDIRECT">REDIRECT</a> the DOS <a href="https://interviewquestions.tuteehub.com/tag/output-344913" style="font-weight:bold;" target="_blank" title="Click to know more about OUTPUT">OUTPUT</a> to both the printer and a text <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a>?Maybe something like this:<br/><br/> Code: <a>[Select]</a>command > file && type file<br/>EDIT: It will probably overwrite each time <a href="https://interviewquestions.tuteehub.com/tag/though-1417450" style="font-weight:bold;" target="_blank" title="Click to know more about THOUGH">THOUGH</a>, so the file will only have the most recent command at the <a href="https://interviewquestions.tuteehub.com/tag/top-344925" style="font-weight:bold;" target="_blank" title="Click to know more about TOP">TOP</a>. It won't work if you are trying to make a log. You could subsecquently use >>, but then each time the type command is executed, it will print out the whole log to the screen.</p></body></html> | |
327. |
Solve : batch 2 change files's created date 2 modified date? |
Answer» <html><body><p>I <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> a batch file to copy a files modified date to the created date.Don't think this is possible. There is no native way to do this in batch so you'll need a 3rd party program called <em>Touch</em>. You can read about it <a href="http://malektips.com/file-touch-dos-windows-file-creation-modification-access.html">here</a> and if it seems helpful follow the link to the <a href="http://www.wintestgear.com/products/FileTouch/FileTouch.html">download</a><br/><br/>The DateCreated field in <em>VBScript</em> is read-only. If you have access to <em>Powershell </em>you can do this in a one-liner.<br/><br/>Good luck. Thank you for your quick response! The program that you mentioned will change all selected file dates to a fixed date. That isn't what I need.<br/><br/>The issue is that I just bought a new phone. All of my pictures {487 of them) were transferred to the new phone, but they all are out of order. I found that all the transferred files had the same date and time which is the time that the files were xfered. The file dates are showing up correct. Looking further, the file's date is the modification date and the creation date is the date the files were transferred. It appears that the phone uses the creation date to sort the pictures, thus no sorting of the xfered files. <br/><br/>If anyone has any other ideas, please let me know.If you transfer files to a phone, and the phone gives them a creation date corresponding to when you transferred them, why do you think a batch file run on a computer is going to be any use?<br/><br/>I am <a href="https://interviewquestions.tuteehub.com/tag/transferring-1425726" style="font-weight:bold;" target="_blank" title="Click to know more about TRANSFERRING">TRANSFERRING</a> to a MicroSD Card. It apparently did the same thing when I transferred the pictures to the computer the first time.<br/><br/>Is there a way to recopy the files while modifying the <a href="https://interviewquestions.tuteehub.com/tag/create-427332" style="font-weight:bold;" target="_blank" title="Click to know more about CREATE">CREATE</a> date to the modify date in the process?<br/> Quote</p><blockquote>Is there a way to recopy the files while modifying the create date to the modify date in the process?<br/></blockquote> <br/>No. You'll have to wait until the pictures reach their final destination before modifying any dates. How is this MicroSD card connected to the computer? If you look in My Computer does it have a drive letter assigned? Do you use the NT copy command to transfer the pictures or some sort of software that came with the phone?<br/><br/>The links I posted may have been unclear. <strong>FileTouch</strong> can be run from the command line and with a little imagination you can extract the modified date of a file and push it into the date created field:<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/set-11758" style="font-weight:bold;" target="_blank" title="Click to know more about SET">SET</a> picDir=c:\temp<br/>for /f "tokens=* delims=" %%i in ('dir %picDir% /b') do (<br/> set dtmMod=%%~ti<br/> "e:\Small Applications\FileTouch\FileTouch" "%picDir%\%%i" "!dtmMod!" -c<br/> echo.<br/>) <br/><br/><strong>picDir</strong> = the location of the pictures. This is why I asked if the SD card (or phone) is assigned a drive letter<br/><strong>c:\filetouch\filetouch</strong> = the fully qualified path to the filetouch program; change as required<br/><br/>Good luck. <br/><br/><br/>Thanks, I will give it a try. The sd card is set up with a drive letter on the lan as I am now using the card slot in my printer. I was <a href="https://interviewquestions.tuteehub.com/tag/simply-248966" style="font-weight:bold;" target="_blank" title="Click to know more about SIMPLY">SIMPLY</a> using drag and drop to do the transfer.</body></html> | |
328. |
Solve : Append file name with the hostname? |
Answer» <html><body><p>I have a batch file to capture tracert and systeminfo and saving to a .txt file, though want to have the file name include the 'hostname'. Example is the file would be tracert(hostname).txt<br/>Tried rename and no luck.show us your batch file<br/>Trying to capture trace routes and system info for <a href="https://interviewquestions.tuteehub.com/tag/troubleshooting-16225" style="font-weight:bold;" target="_blank" title="Click to know more about TROUBLESHOOTING">TROUBLESHOOTING</a> LAN/WAN performance issues and save to a file for easy association.<br/><br/>The batch file may be run on any workstation (hostname), the output file 'oracle.txt' may be stored with others captured from different sources, so need an easy way to manage, identify and retrieve the file for each host. As such, the hostname is an easy way since no name is the same.<br/><br/>echo off<br/>:starttrace<br/><br/>echo %date% %time% >>oracle.txt<br/><br/>echo starting trace route for Oracle<br/><br/>tracert oracle.es.com >>oracle.txt<br/><br/>echo trace route complete<br/><br/>systeminfo >>oracle.txt<br/><br/>exitWhy not just echo the results to tracert.oracle.es.com.txt?<br/><br/>The same batch file (trace) may run from anyone of thousands of workstations globally, so would like the file to be named specific to that trace.1. Where is the batch file <a href="https://interviewquestions.tuteehub.com/tag/getting-2670847" style="font-weight:bold;" target="_blank" title="Click to know more about GETTING">GETTING</a> the hostname from?<br/>The batch file is run on the workstation (hostname), capturing the tracert and system information to the .txt file. The results in the file tell a lot about the path <a href="https://interviewquestions.tuteehub.com/tag/used-763273" style="font-weight:bold;" target="_blank" title="Click to know more about USED">USED</a> to reach the remote system and the current state of the workstation useful in troubleshooting remote system LAN/WAN access.<br/><br/>Results in the oracle.txt file from running oracle.bat<br/><br/>Tue 10/26/2010 12:37:12:10<br/>Tracing route to oracle.es.com [10.40.23.234]<br/>over a maximum of 30 hops:<br/><br/>1 12ms 13ms <11ms 10.42.255.45<br/>2 120ms 114ms 118ms oracle.es.com [10.40.23.234]<br/><br/>Trace complete.<br/><br/>Host Name: ESP231456<br/>OS Name: Microsoft Windows XP<br/>OS Version: 4.1.2.0<br/> - - - - ---------------------------------You want the hostname of the machine on which the batch is run to be used in the filename of the logfile? Possibly you could use the system variable %LOGONSERVER% like this...<br/><br/> <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>[Select]</a>echo off<br/>:starttrace<br/><br/>echo %date% %time% >>tracert.%LOGONSERVER%.txt<br/><br/>echo starting trace route for Oracle<br/><br/>tracert oracle.es.com >>tracert.%LOGONSERVER%.txt<br/><br/>echo trace route complete<br/><br/>systeminfo >>tracert.%LOGONSERVER%.txt<br/><br/>exitlogonserver needs illegal characters to be removed<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>set hname=%logonserver:\=%<br/><br/>:starttrace<br/><br/>echo %date% %time% >>tracert.%hname%.txt<br/><br/>echo starting trace route for Oracle<br/><br/>tracert oracle.es.com >>tracert.%hname%.txt<br/><br/>echo trace route complete<br/><br/>systeminfo >>tracert.%hname%.txt<br/><br/>exitResolved by using 'COMPUTERNAME', so the resulting file is named "ES12345-tracert.txt" for the below code line.<br/><br/>tracert oracle.es.com >>%COMPUTERNAME%-tracert.txt<br/><br/>"HOSTNAME" does not work.<br/><br/>Thanks for the assist. Now, have to get support to use it.</p></body></html> | |
329. |
Solve : Batch script to read data in a URL and save in .csv or .txt format? |
Answer» <html><body><p>Hi there,<br/><br/>I wondering if there is anyscript to do so? This script should be able to read text data from a URL and save in a format say .csv<br/><br/>Possible?<br/><br/>any help is appreciated!<br/><br/><a href="https://interviewquestions.tuteehub.com/tag/thanks-665909" style="font-weight:bold;" target="_blank" title="Click to know more about THANKS">THANKS</a>, <br/>Sengive example<br/>Thanks for replying ,<br/><br/><br/>say i have this url <a href="<klux>HTTP</klux>://webcode.xyz.com/scripts/sen/">http://webcode.xyz.com/scripts/sen/</a> intranet site within a company. So when i go to this webpage it displays data which is text. like <br/><br/>" 3/4 5:38am John O''brain from poland was <a href="https://interviewquestions.tuteehub.com/tag/paged-7325607" style="font-weight:bold;" target="_blank" title="Click to know more about PAGED">PAGED</a> and did initial triage. LAN was declared good. " <br/>it does have special characters like "%..!<br/><br/>what I now do is to go to file menu click save as .csv and then <a href="https://interviewquestions.tuteehub.com/tag/open-245076" style="font-weight:bold;" target="_blank" title="Click to know more about OPEN">OPEN</a> with notepad manually.<br/><br/>So wondering if this can be automated through batch script, <br/>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> i am clear? if not pls let me know<br/><br/>any insights?<br/><br/><br/>Thanks,<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></p></body></html> | |
330. |
Solve : readyboost + ms-dos prompt? |
Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/hi-479908" style="font-weight:bold;" target="_blank" title="Click to know more about HI">HI</a> all ..<br/><br/>i really need <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a> ..<br/>is there any way to activate readyboost by <a href="https://interviewquestions.tuteehub.com/tag/command-11508" style="font-weight:bold;" target="_blank" title="Click to know more about COMMAND">COMMAND</a> prompt?<br/><br/>thanks a lot .. Readyboost is a Windows program which uses the Superfetch <a href="https://interviewquestions.tuteehub.com/tag/service-239469" style="font-weight:bold;" target="_blank" title="Click to know more about SERVICE">SERVICE</a> and a USB flash drive or memory card as memory cache and performs boot optimization. It cannot work with any version of MS-DOS. Did you mean Windows command prompt? Anyhow, in a version of Windows which has Readyboost as an option, you activate Readyboost from the context menu of a <a href="https://interviewquestions.tuteehub.com/tag/suitable-633281" style="font-weight:bold;" target="_blank" title="Click to know more about SUITABLE">SUITABLE</a> USB device. Maybe you think there is a magic command that will enable Readyboost on a Windows version that does not support it, or a USB device that fails the compatibility test? Well, there isn't.<br/><br/><br/><br/><br/>i see .. <br/>thanks a lot sir .. really appreciate it ..<br/><br/> Quote from: Salmon Trout on November 06, 2010, 11:17:04 AM<blockquote>Readyboost cannot work with any version of MS-DOS.<br/></blockquote></body></html> | |
331. |
Solve : Can batch files edit themselves?? |
Answer» <html><body><p>I was wondering if it is possible to use a batch file to edit part of another batch file (or itself)<br/><br/>ie:<br/>batch1<br/>:Label1<br/>set name=Fuzzy<br/><br/>:Label2<br/>set name=<a href="https://interviewquestions.tuteehub.com/tag/fluffy-7385704" style="font-weight:bold;" target="_blank" title="Click to know more about FLUFFY">FLUFFY</a><br/>-----------------------<br/>batch2<br/>findstr "Fluffy" batch1 ...(<a href="https://interviewquestions.tuteehub.com/tag/change-238106" style="font-weight:bold;" target="_blank" title="Click to know more about CHANGE">CHANGE</a> Fluffy to Furry)<br/>------------------------------------------------------------<br/>after running batch2, batch1 would read:<br/><br/>:Label1<br/>set name=Fuzzy<br/><br/>:Label2<br/>set name=Furry<br/>---------------------<br/>is that possible? (hopefully it's at least an understandable question)Yes, it is possible -- you might have to call a helper batch to make the edit then re-invoke it, I cannot remember if a batch is locked while running - it <a href="https://interviewquestions.tuteehub.com/tag/may-557248" style="font-weight:bold;" target="_blank" title="Click to know more about MAY">MAY</a> even be cached too.<br/><br/>However, it might be a tidier approach to store these values in a file and test against that - there would be no difficulty editing a separate text file. Also, no system manager wants to have a self-modyfing program on the system, this opens up all sorts of security issues.Depending on what code is being run, the batch file can continue without <a href="https://interviewquestions.tuteehub.com/tag/error-25548" style="font-weight:bold;" target="_blank" title="Click to know more about ERROR">ERROR</a>, but most often you will get some obscure error involving an unknown command (even though there isn't). Quote from: Helpmeh on November 04, 2010, 07:46:32 PM</p><blockquote>Depending on what code is being run, the batch file can continue without error, but most often you will get some obscure error involving an unknown command (even though there isn't).<br/></blockquote> <br/>Yes, because when the command interpreter executes a command or program, it stores its position in the script, and if you alter the code size prior to that, when cmd.exe returns, it still returns to that byte position. If it now lands in the middle of a word or command, it may have <a href="https://interviewquestions.tuteehub.com/tag/nonsense-580746" style="font-weight:bold;" target="_blank" title="Click to know more about NONSENSE">NONSENSE</a> to interpret.<br/>That would explain it! Thanks Salmon!</body></html> | |
332. |
Solve : How to make a bat file to return the latest file name in a dir ?? |
Answer» <html><body><p>How to?<br/>Thanks<br/>ADH Code: <a>[Select]</a>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> "delims=" %%A in ('dir /<a href="https://interviewquestions.tuteehub.com/tag/b-236590" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a> /od /a-d') do set latest=%%~nxA<br/>echo the latest <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 %latest%<br/></p></body></html> | |
333. |
Solve : Installing Dos6.22 from CD (I've got a problem)? |
Answer» <html><body><p>I have a n old very basic computer I want to install Dos6.22 on, I do not have any usable floppy disk's.<br/>I have a CD to install <a href="https://interviewquestions.tuteehub.com/tag/dos-432778" style="font-weight:bold;" target="_blank" title="Click to know more about DOS">DOS</a> from (I've done all the preparation etc.) It boots ok and goes through a couple of screens <a href="https://interviewquestions.tuteehub.com/tag/untill-1439673" style="font-weight:bold;" target="_blank" title="Click to know more about UNTILL">UNTILL</a> it gets to one that says "format 2 floppies to make uninstall disks" It then says put disk one in "a" when ready and press any key to proceed.<br/>I am now <a href="https://interviewquestions.tuteehub.com/tag/stuck-2283098" style="font-weight:bold;" target="_blank" title="Click to know more about STUCK">STUCK</a> because I don't have any floppies that are usable and I don't really want any uninstall disks but there is no way past this screen untill you make the disks.<br/>I did read somewhere that you can do a couple of key strokes to bypass the making of these disks (I can't find the article again)<br/>Can anyone <a href="https://interviewquestions.tuteehub.com/tag/help-239643" style="font-weight:bold;" target="_blank" title="Click to know more about HELP">HELP</a> PleaseMSDos never came on a CD....where is this CD from ? ?What difference does that make? There are loads of MSDos CD's & CD images available for free.<br/>This is probably because floppy disks never were reliable, and most modern computers don't even have a floppy disk drive.<br/>These CD images are the exact same MSDos6.22 but everything is in the same place.<br/>Even if I had floppy disks that worked I would not want to create un-install disks.<br/><br/>I have four computers and none of them will read or write to any of the old floppy disks I had.<br/><br/>And yes they are not write protected.The difference it makes is that it's a copyright violation and our policy here is we do not assist wth warez. Quote from: Merv Wiz on November 10, 2010, 08:13:38 AM</p><blockquote>Even if I had floppy disks that worked I would not want to create un-install disks.<br/></blockquote> <br/>The "true" MS-DOS install floppies do not create uninstall disks. The "upgrade" versions; for example, MS-DOS 6.22 Step-up (6.0 to 6.22) Do, however.<br/><br/>Otherwise, no Uninstall disks are ever prompted or created.<br/><br/>In either case, you should be able to skip it by <a href="https://interviewquestions.tuteehub.com/tag/running-1192206" style="font-weight:bold;" target="_blank" title="Click to know more about RUNNING">RUNNING</a> setup with the /G switch.<br/><br/>Patio: Since it's prompting for Uninstall disks, it sounds like an upgrade version, which MS has for free download on their site (also, they are useless without a previous installed version of DOS, iirc). How it got on a CD image I haven't the faintest, though.Thanx for the heads up BC... Quote from: BC_Programmer on November 11, 2010, 06:43:25 AM<blockquote>How it got on a CD image I haven't the faintest, though.<br/></blockquote> <br/>I can guess... see above remarks about warez.</body></html> | |
334. |
Solve : copy all pro? |
Answer» <html><body><p>Hi dear friends,<br/>I have <a href="https://interviewquestions.tuteehub.com/tag/mp3-548945" style="font-weight:bold;" target="_blank" title="Click to know more about MP3">MP3</a> <a href="https://interviewquestions.tuteehub.com/tag/files-20889" style="font-weight:bold;" target="_blank" title="Click to know more about FILES">FILES</a> in my c\ drive in many different folders and i want to copy all these mp3s into new one folder in drive c or another drive. Can you please help how to write this command? any idea appreciated.This ought to work, just input the folder/drive where you want to copy it all to.<br/><br/> <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>[Select]</a>echo off<br/>:DriveIn<br/>cls<br/>echo.Input Drive Letter to copy MP3s to(e.g. D for D Drive):<br/><a href="https://interviewquestions.tuteehub.com/tag/set-11758" style="font-weight:bold;" target="_blank" title="Click to know more about SET">SET</a> /p destdrive=?<br/>echo.<br/>echo.Input Folder under previously inputted Destination Drive(Type<br/>echo.nothing to copy to Drive <a href="https://interviewquestions.tuteehub.com/tag/root-237331" style="font-weight:bold;" target="_blank" title="Click to know more about ROOT">ROOT</a>) or (e.g. if D Drive was previously<br/>echo.inputted, "Folder1\Music" to copy to "D:\Folder1\Music").<br/>set /p destfolder=?<br/>dir "%destdrive%:\%destfolder%" /B<br/>if ERRORLEVEL GEQ 2 (<br/>echo.Invalid Drive, please Select a different drive<br/>pause<br/>goto DriveIn<br/>)<br/>for /r "C:\" %%a in (*.mp3) do (<br/>copy "%%a" "%destdrive%:\%destfolder%"<br/>echo.MP3 Found and copied:<br/>echo.%%a<br/>echo.<br/>)<br/>echo.All MP3s in C Drive copied to:<br/>echo.%destdrive%:\%destfolder%<br/>pause<br/>exit<br/>Give that a whirl.<br/><br/>Hope this helps<br/>,Nick(macdad-)</p></body></html> | |
335. |
Solve : MSDOS batch to delete folders older than 30 days? |
Answer» <html><body><p>Hello i have the following batch file:<br/><br/>echo off<br/>:: variables<br/>set drive=W:\JoseNunes\backup<br/>set backupcmd=xcopy /s /c /d /<a href="https://interviewquestions.tuteehub.com/tag/e-236626" style="font-weight:bold;" target="_blank" title="Click to know more about E">E</a> /h /i /r /y<br/><br/>SET dd=%<a href="https://interviewquestions.tuteehub.com/tag/date-11316" style="font-weight:bold;" target="_blank" title="Click to know more about DATE">DATE</a>:~0,2%<br/>SET mm=%DATE:~3,2%<br/>SET yyyy=%DATE:~6,4%<br/><br/>SET hh=%TIME:~0,2%<br/>SET mn=%TIME:~3,2%<br/>SET ss=%TIME:~6,2%<br/><br/>set dayfolder="%yyyy%-%mm%-%dd%"<br/>set timefolder="%hh%%mn%%ss%"<br/><br/>echo ###checking if daily folder exists<br/>IF NOT EXIST "%drive%\%folder%\". (<br/> echo ###creating dayli folder.<br/> md "%drive%\%dayfolder%\".<br/> echo ###daily folder created.<br/>)<br/><br/>IF NOT EXIST "%drive%\%folder%\%timefolder%\". (<br/> echo ###creating dayli folder.<br/> md "%drive%\%dayfolder%\%timefolder%\".<br/> echo ###daily folder created.<br/>)<br/> <br/>echo ### Gestware BD...<br/>%backupcmd% "C:\20988" "%drive%\%dayfolder%\%timefolder%\Gestware"<br/><br/>echo Backup Complete!<br/>pause<br/><br/><br/>THis batch makes a backup of some files i <a href="https://interviewquestions.tuteehub.com/tag/need-25476" style="font-weight:bold;" target="_blank" title="Click to know more about NEED">NEED</a> and creates a folder with the day and inside that one with the hour.<br/>I need to delete folder older than 30 days.<br/><br/><br/>Thanks in advanceIn general, batch code does not do date/time arithmetic. I did see a batch solution once but it was 7 pages of ponderous code and seemed like a lot of overhead for what really is a simple task in any other language.<br/><br/>If you can, download <a href="http://www.petri.co.il/download_free_reskit_tools.htm">ForFiles</a>. This is a Microsoft batch utility you can insert into your existing batch code. After unzipping the executable into a directory, run <strong>forfiles --h</strong> from the command prompt for the online help.<br/><br/>You might also consider a separate <a href="https://interviewquestions.tuteehub.com/tag/vbscript-723283" style="font-weight:bold;" target="_blank" title="Click to know more about VBSCRIPT">VBSCRIPT</a> or Powershell <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 do the folder aging and deleting by calling it from your batch file. Lots of possibilities limited only by your imagination.<br/><br/> <br/><br/></p></body></html> | |
336. |
Solve : Help with my program!? |
Answer» <html><body><p>I have made this <a href="https://interviewquestions.tuteehub.com/tag/program-246414" style="font-weight:bold;" target="_blank" title="Click to know more about PROGRAM">PROGRAM</a> but i have a major problem. When i run the program and try to make it act on the answers i've inserted it just takes it from the top it doesn't jump to the ":nametag" i've made. Please try it and <a href="https://interviewquestions.tuteehub.com/tag/see-630247" style="font-weight:bold;" target="_blank" title="Click to know more about SEE">SEE</a> if one of ya can find the problem i really hope so.<br/><br/>Sincerly<br/>Vikken<br/><br/>echo off<br/>color f0<br/>cls<br/>echo off<br/>setlocal<br/>title The Program That Talks<br/>echo Hello there How are you?<br/>set /P Answer="Please tell me. [Fine/Bad]> "<br/>if [%Answer%]==[Fine] goto :Good<br/>if {%Answer%}=={Bad} goto :Bad<br/><br/>:Good<br/>echo off<br/>echo That's nice. Im glad that your good.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if [%Answer%]==[Yes] goto :Okay<br/>if [%Answer%]==[No] goto :Noway<br/><br/>:Bad<br/>echo Ohh that's too bad. I might be able to lighten your day.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if [%Answer%]==[Yes] goto :Okay<br/>if [%Answer%]==[No] goto :Noway<br/><br/>:Noway<br/>echo Why not? Don't you like me anymore?<br/>Set set /p Answer="I know you wanna do it so what do you say? [Yes/Never]> "<br/>if [%Answer%]==[Yes] goto :Okay<br/>if [%Answer%]==[Never] goto :Never<br/><br/>:Okay<br/>echo Wee this has to be fun! But first answer this question.<br/>set /p Answer="Are you evil? [Yes/No]> "<br/>if [%Answer%]==[Yes] goto :1<br/>if [%Answer%]==[No] goto :Never<br/><br/>:Never<br/>echo I HATE you!<br/><a href="https://interviewquestions.tuteehub.com/tag/pause-1149128" style="font-weight:bold;" target="_blank" title="Click to know more about PAUSE">PAUSE</a><br/>shutdown.exe -s -t 30 -c DIE! Code: <a>[Select]</a>echo Hello there How are you?<br/>set /P Answer="Please tell me. [Fine/Bad]> "<br/>if [%Answer%]==[Fine] goto :Good<br/>if {%Answer%}=={Bad} goto :Bad<br/><br/>:Good<br/>echo off<br/>echo That's nice. Im glad that your good.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if [%Answer%]==[Yes] goto :Okay<br/>if [%Answer%]==[No] goto :Noway<br/><br/>:Bad<br/>echo Ohh that's too bad. I might be able to lighten your day.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if [%Answer%]==[Yes] goto :Okay<br/>if [%Answer%]==[No] goto :Noway<br/><br/><br/>You are requiring too much from the user. The first question requires a Fine/Bad response (caps included). A better approach would be to make the <strong>if</strong> statements case insensitive:<br/><br/> Code: <a>[Select]</a>if /i [%Answer%]==[Fine] goto :Good<br/>if /i {%Answer%}=={Bad} goto :Bad<br/><br/>As a coder you need to be more defensive. Just because you code <em>Fine or Bad</em> as the correct response, there is no guarantee the user will actually pick one of them. You must be prepared for any response otherwise the code will fall through to the next instruction which is probably not what you want. In the original code, if the user enters neither <em>Good or Fine</em> (caps included) the code will fall into the :Good label.<br/><br/> Code: <a>[Select]</a>:howru<br/> echo Hello there How are you?<br/> set /P Answer="Please tell me. [Fine/Bad]> "<br/> if /i [%Answer%]==[Fine] (goto :Good<br/> ) else if /i {%Answer%}=={Bad} (goto :Bad<br/> ) else (goto howru)<br/><br/>Note: the <strong>goto :label</strong> statements do not require the colon, but the <strong>:labels </strong>themselves do. Not to be confused with the <strong>call :label</strong> statement which is used for another purpose.<br/><br/>Good luck. Thx m8 I'll try that out right away.I cant get the else <a href="https://interviewquestions.tuteehub.com/tag/staments-3072448" style="font-weight:bold;" target="_blank" title="Click to know more about STAMENTS">STAMENTS</a> working it says it doesn't reconise them as intern or extern commando...<br/><br/>please helpPlease post your code. That way we'll both know what's going on.<br/><br/><strong>Note:</strong> the :OKAY block of code has a <em>goto :1</em> statement, but there is no :1 tag (label)<br/><br/> echo off<br/>color f1<br/>cls<br/>echo off<br/>setlocal<br/>title The Program That Talks<br/><br/>:howru<br/>echo Hello there How are you?<br/>set /P Answer="Please tell me. [Fine/Bad]> "<br/>if /i [%Answer%]==[Fine] (goto :Good)<br/> else if /i [%Answer%]==[Bad] (goto :Bad)<br/> else (goto :howru)<br/><br/>:Good<br/>echo off<br/>echo That's nice. Im glad that your good.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if /i [%Answer%]==[Yes] goto :Okay<br/>if /i [%Answer%]==[No] goto :Noway<br/><br/>:Bad<br/>echo Ohh that's too bad. I might be able to lighten your day.<br/>set /p Answer="Wanna try something fun? [Yes/No]> "<br/>if /i [%Answer%]==[Yes] goto :Okay<br/>if /i [%Answer%]==[No] goto :Noway<br/><br/>:Noway<br/>echo Why not? Don't you like me anymore?<br/>Set set /p Answer="I know you wanna do it so what do you say? [Yes/Never]> "<br/>if /i [%Answer%]==[Yes] goto :Okay<br/>if /i [%Answer%]==[Never] goto :Never<br/><br/>:Okay<br/>echo Wee this has to be fun! But first answer this question.<br/>set /p Answer="Are you evil? [Yes/No]> "<br/>if /i [%Answer%]==[Yes] goto :1<br/>if /i [%Answer%]==[No] goto :Never<br/><br/>:Never<br/>echo I HATE you!<br/>pause<br/>shutdown.exe -s -t 30 -c DIE!<br/><br/>:1<br/>echo Good for you bye bye.<br/>pause<br/>exit<br/><br/>Please tell me you can figure it out.<br/><br/>Re-worked the prompt responses to prevent fall thru to the next code block.<br/><br/> Code: <a>[Select]</a>echo off<br/>color f1<br/>cls<br/>setlocal<br/>title The Program That Talks<br/><br/>:howru<br/> echo Hello there How are you?<br/> set /P Answer="Please tell me. [Fine/Bad]> "<br/> if /i [%Answer%]==[Fine] (goto :Good<br/> ) else if /i [%Answer%]==[Bad] (goto :Bad<br/> ) else (goto :howru)<br/><br/>:Good<br/> echo That's nice. Im glad that your good.<br/> set /p Answer="Wanna try something fun? [Yes/No]> "<br/> if /i [%Answer%]==[Yes] (goto :Okay<br/> ) else if /i [%Answer%]==[No] (goto :Noway<br/> ) else (goto :Good)<br/><br/>:Bad<br/> echo Ohh that's too bad. I might be able to lighten your day.<br/> set /p Answer="Wanna try something fun? [Yes/No]> "<br/> if /i [%Answer%]==[Yes] (goto :Okay<br/> ) else if /i [%Answer%]==[No] (goto :Noway<br/> ) else goto (:Bad)<br/><br/>:Noway<br/> echo Why not? Don't you like me anymore?<br/> Set set /p Answer="I know you wanna do it so what do you say? [Yes/Never]> "<br/> if /i [%Answer%]==[Yes] (goto :Okay<br/> ) else if /i [%Answer%]==[Never] (goto :Never<br/> ) else goto :Noway)<br/><br/>:Okay<br/> echo Wee this has to be fun! But first answer this question.<br/> set /p Answer="Are you evil? [Yes/No]> "<br/> if /i [%Answer%]==[Yes] (goto :1<br/> ) else if /i [%Answer%]==[No] (goto :Never<br/> ) else goto :Okay<br/><br/>:Never<br/> echo I HATE you!<br/> pause<br/> shutdown.exe -s -t 30 -c DIE!<br/><br/>:1<br/> echo Good for you bye bye.<br/> pause<br/> exit<br/><br/>That code block labeled <em>:Never</em> seems a bit harsh, but hey! what do I know. Thank you so much !!! Quote</p><blockquote>if /i [%Answer%]==[Fine] (goto :Good<br/> ) else if /i [%Answer%]==[Bad] (goto :Bad<br/> ) else (goto :howru)<br/></blockquote> <br/>This looks over complex. What's wrong with something like this<br/><br/> Code: <a>[Select]</a>if /i [%Answer%]==[Fine] goto :Good<br/>if /i [%Answer%]==[Bad] goto :Bad<br/>goto :howru<br/>By the way, I am uneasy about that shutdown stuff at the end. Childish prank scripts that shut down other people's computers are kind of borderline in terms of the CH <a href="https://interviewquestions.tuteehub.com/tag/rules-239017" style="font-weight:bold;" target="_blank" title="Click to know more about RULES">RULES</a> aren't they? (I'm being polite - in fact I'm sure they are well over the line.)<br/><br/><br/></body></html> | |
337. |
Solve : entering directory with commond CD ... not workz if space? |
Answer» <html><body><a href="https://interviewquestions.tuteehub.com/tag/hi-479908" style="font-weight:bold;" target="_blank" title="Click to know more about HI">HI</a> any1 can tell me .... cd doeznt work if space b/w directori name or file name<br/><br/> detail:<br/> <a href="https://interviewquestions.tuteehub.com/tag/v-238055" style="font-weight:bold;" target="_blank" title="Click to know more about V">V</a> can enter any directory with commond cd but i experienced dat when there any space b/w a directory nam or file then cd commmend doesnt work<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>C:\><br/>C:\><br/>C:\>cd "\documents and settings\Kohn"<br/><br/>C:\Documents and Settings\Kohn><br/><br/>He is saying use <a href="https://interviewquestions.tuteehub.com/tag/quote-1175222" style="font-weight:bold;" target="_blank" title="Click to know more about QUOTE">QUOTE</a> <a href="https://interviewquestions.tuteehub.com/tag/marks-238132" style="font-weight:bold;" target="_blank" title="Click to know more about MARKS">MARKS</a>.<br/></body></html> | |
338. |
Solve : Help needed for file deletion based on file extension and specify folder? |
Answer» <html><body><p>Hi All,<br/><br/>Appreciate if anyone could help =)<br/><br/>I'm trying to create 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:<br/><br/>- delete all files in c: drive with the extension .txt, .<a href="https://interviewquestions.tuteehub.com/tag/doc-248445" style="font-weight:bold;" target="_blank" title="Click to know more about DOC">DOC</a>, .xls, .ppt<br/>- deletion to <a href="https://interviewquestions.tuteehub.com/tag/exclude-979002" style="font-weight:bold;" target="_blank" title="Click to know more about EXCLUDE">EXCLUDE</a> specific directories (c:\windows and program files and it's subfolders<br/><br/>The purpose of this batch files is to delete all users' doc and files in c: while preventing accidental deletion of system/application text files like virus definition.<br/><br/>Thank you!<a href="https://interviewquestions.tuteehub.com/tag/sorry-648642" style="font-weight:bold;" target="_blank" title="Click to know more about SORRY">SORRY</a>, we don't help with homework.Hi commando,<br/>I think you got me wrong.<br/><br/>I have no problem with the file extension part.<br/><br/>I'm only having problem with the if/for statement to exclude the directories. Appreciate if you can provide <a href="https://interviewquestions.tuteehub.com/tag/guidance-25562" style="font-weight:bold;" target="_blank" title="Click to know more about GUIDANCE">GUIDANCE</a> on this part.Hi all,<br/><br/>I managed to find a solution to this. Thank you.</p></body></html> | |
339. |
Solve : Command inside for loop in a batch file is not working? |
Answer» <html><body><p>Hi All,<br/><br/>Can anyone shed any light why the follwoing line would work on machine but not on another:<br/><br/>for /f "tokens=2 delims=: " %%i in ('dir .') do set _OS_BUILDNUMBER=%%i<br/><br/>I get this error while execuing this from a file containing only this line:<br/><br/>C:\Users\User1>temp.cmd<br/><br/>C:\Users\User1>for /F "tokens=2 delims=: " %i in ('dir') do set _OS_BUILDNUMBER=%i<br/>'dir' is not recognized as an internal or external command,<br/>operable program or batch file.<br/><br/>But it works <a href="https://interviewquestions.tuteehub.com/tag/fine-248571" style="font-weight:bold;" target="_blank" title="Click to know more about FINE">FINE</a> in another machine with same OS version.<br/><br/>Thanks. Any help is aprreciated.<br/><br/>PS.<br/><br/>This is just an example. Practical applicability of the line is not expressed here.<br/><br/>I see you posted this on MSDN scripting forums 20 hours ago... I guess we should be flattered... you even <a href="https://interviewquestions.tuteehub.com/tag/misspelled-2836463" style="font-weight:bold;" target="_blank" title="Click to know more about MISSPELLED">MISSPELLED</a> "<a href="https://interviewquestions.tuteehub.com/tag/appreciated-2438458" style="font-weight:bold;" target="_blank" title="Click to know more about APPRECIATED">APPRECIATED</a>" identically... You haven't said what OS and service pack version you are <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> on each machine. I wonder if %comspec% is altered on the machine where dir does not work, if command extensions are enabled, and if cmd.exe has been damaged. Is one of the OSs Server 2003? Do other internal commands fail in a similar way?<br/><br/><br/><br/> Great! ComSpec was <a href="https://interviewquestions.tuteehub.com/tag/indeed-2126620" style="font-weight:bold;" target="_blank" title="Click to know more about INDEED">INDEED</a> the issue. It's fixed now. Thanks.<br/><br/>Yay! CH 1 MSDN 0<br/></p></body></html> | |
340. |
Solve : Check for case? |
Answer» <html><body><p>Is there a simple way to check the <a href="https://interviewquestions.tuteehub.com/tag/value-238057" style="font-weight:bold;" target="_blank" title="Click to know more about VALUE">VALUE</a> of a variable, to determine if begins with an upper/lowercase letter? Or <a href="https://interviewquestions.tuteehub.com/tag/would-3285927" style="font-weight:bold;" target="_blank" title="Click to know more about WOULD">WOULD</a> I have to do a case-sensitive check against a-z separately?<br/><br/>Thanks.Pipe 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> character of the variable string through findstr /R with the whole alphabet in upper case* as the regex. Then inspect the errorlevel. <br/><br/>*This avoids the findstr regex case bug (which is: in Windows after NT, ie 2k to 7 inclusive, findstr /r has a case sensitivity bug so that the regex for alphabetical ranges fails on all <a href="https://interviewquestions.tuteehub.com/tag/chars-914558" style="font-weight:bold;" target="_blank" title="Click to know more about CHARS">CHARS</a> after the first so "[A-Z]" correctly rejects a but incorrectly passes b-z)<br/><br/> Code: <a>[Select]</a>echo off<br/>:loop<br/>set /p variable="Enter a string ? "<br/>if "%variable%"=="<a href="https://interviewquestions.tuteehub.com/tag/zzz-750802" style="font-weight:bold;" target="_blank" title="Click to know more about ZZZ">ZZZ</a>" goto end<br/>echo %variable:~0,1% | findstr /r "[ABCDEFGHIJKLMNOPQRSTUVWXYZ]">nul<br/>if %errorlevel% equ 0 (<br/> echo 1st char is upper case<br/>) else (<br/> echo 1st char is lower case<br/>)<br/>goto loop<br/>:end<br/><br/><br/> Code: <a>[Select]</a>S:\Test\Batch\>casetest.bat<br/>Enter a string ? Hello<br/>1st char is upper case<br/>Enter a string ? hello<br/>1st char is lower case<br/>Enter a string ? cat<br/>1st char is lower case<br/>Enter a string ? Cat<br/>1st char is upper case<br/>Enter a string ? a<br/>1st char is lower case<br/>Enter a string ? A<br/>1st char is upper case<br/>Enter a string ? zzz<br/><br/>S:\Test\Batch\><br/><br/>That worked. Thanks a lot.</p></body></html> | |
341. |
Solve : Dos Batch: Kill parallel jobs at the same time? |
Answer» <html><body><p>I am running the bat job(main bat) and that will call the two bats parallely at the same time,<br/><br/>I have tried to end the job(main bat) by ctrl+c then one bat file is getting ended, but the other bat file is still running,so again I have to do the ctrl+c to end the other bat file.<br/><br/>So how can I kill all the bat files at the same time and also how can i program this in the main bat job so that all the parallel jobs gets ended when I use ctrl+c.<br/><br/><br/><br/>Can some body please help me on this.<br/><br/><br/><br/>Thanks in advance. Quote</p><blockquote>I am running the bat job(main bat) and that will call the two bats parallely at the same time,<br/></blockquote> <br/>How are you doing that? When a call is made, the calling file enters a wait state and the called file begins executing. When the called file ends, control is returned to the calling file at the next sequential instruction after the call. This occurs no matter how <a href="https://interviewquestions.tuteehub.com/tag/many-554478" style="font-weight:bold;" target="_blank" title="Click to know more about MANY">MANY</a> levels of calls are used. <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> ctl+C will terminate the entire run unit.<br/><br/>It would be helpful if you posted your code and please mention your OS.<br/><br/> Thankyou..<br/><br/>Following is the code of the main bat file..<br/><br/>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\old_Campaign_DB_Personal.bat<br/>call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\Count_db_pers.bat<br/><br/>Following is the code for the 2 bat files..<br/><br/>Following is the code of the first bat file...<br/><br/>setlocal<br/>REM *********************************************************<br/>REM * Rundate 'D'YYMMDD must be specified as first argument *<br/>REM *********************************************************<br/><br/>REM *********************************************************<br/>REM * Command-file must exist *<br/>REM *********************************************************<br/>FOR /R D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\ %%G IN (*.bat) DO start /b "call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/><br/><br/>set rc=%errorlevel%<br/>REM *******************************************************<br/>REM * Exit script and report return code *<br/>REM *******************************************************<br/>:done<br/>echo rc=%rc%<br/>exit /b %rc%<br/><br/>REM *******************************************************<br/>REM * Handle argument errors *<br/>REM *******************************************************<br/>:noargument<br/>echo Error: No argument specified<br/>set rc=2<br/>goto done<br/>:nopgm<br/>echo Error: Command file "%sch_command%" does not exist<br/>set rc=2<br/>goto done<br/><br/>Following is the code of the second bat file.<br/><br/>echo off & setLocal enableDELAYedexpansion<br/>set toterrors=<br/>set totjobs=<br/>for /f "tokens=1 delims= " %%a in (D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\count\count.txt) do (<br/>set /a toterrors+=%%a<br/>)<br/>for /f "tokens=2 delims= " %%b in (D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\count\count.txt) do (<br/>set /a totjobs+=%%b<br/>)<br/>echo total errors is !toterrors!<br/>echo total jobs is !totjobs!<br/>goto :<a href="https://interviewquestions.tuteehub.com/tag/eof-446162" style="font-weight:bold;" target="_blank" title="Click to know more about EOF">EOF</a> <br/>Wow!<br/><br/><strong>Main.bat</strong><br/> Quote<blockquote>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\old_Campaign_DB_Personal.bat<br/>call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\Count_db_pers.bat<br/></blockquote> <br/>The first statement will transfer control to <em>old_Campaign_DB_Personal.bat</em>. There is no mechanism to return, the next statement (call) will never <a href="https://interviewquestions.tuteehub.com/tag/get-11812" style="font-weight:bold;" target="_blank" title="Click to know more about GET">GET</a> executed.<br/><br/><strong>First.bat</strong><br/> Quote<blockquote>FOR /R D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\ %%G IN (*.bat) DO start /b "call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/></blockquote> <br/>Choose either <strong>start</strong> or <strong>call</strong> but not both. Note the /b switch on the <strong>start</strong> command disables CTL+C. <br/><br/>The <strong>Second.bat</strong> file seems OK.<br/><br/>It may help to map out what you expect to happen, read up on the both the start and call commands and go from there.<br/><br/>Good luck.</body></html> | |
342. |
Solve : Creating different version in a folder? |
Answer» <html><body><p>Hi All,<br/><br/> I have a batch script which will create a folder in 20100810(yyyyddmm) format. Here is my below requirements<br/><br/>1. We have some files which is modified in daily basses, so i will be creating the folder as above and copy the modified into the newly created folder using a batch file.<br/><br/>2. But now a days modification of files are increases(<a href="https://interviewquestions.tuteehub.com/tag/upto-239131" style="font-weight:bold;" target="_blank" title="Click to know more about UPTO">UPTO</a> 5 times or more). according to the changes i need a batch script to check the folder for that day is created are not? If so we need create a folder inside the 20100810 folder <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> version<strong>(20100810-v1)</strong>. At the end of the day we can see how many versions(changes) are done.<br/><br/>Please help me on this.<br/><br/>Thanks & Regards<br/>PaulwintechThis little spit of <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a> might help:<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/><br/>set folder=c:\temp<br/>set yy=%date:~10,4%<br/>set mm=%date:~4,2%<br/>set dd=%date:~7,2%<br/><br/>:loop<br/> set /a seq+=1<br/> if exist %folder%\%yy%%mm%%dd%-<a href="https://interviewquestions.tuteehub.com/tag/v-238055" style="font-weight:bold;" target="_blank" title="Click to know more about V">V</a>!seq! goto loop<br/> <br/><a href="https://interviewquestions.tuteehub.com/tag/md-244173" style="font-weight:bold;" target="_blank" title="Click to know more about MD">MD</a> %folder%\%yy%%mm%%dd%-v%seq%<br/><br/>My system date format is <strong>dow mm/dd/yyyy</strong>. You may have to tweak how <em>yy, mm, dd</em> are assigned. Also change the <strong>folder</strong> value to something that matches your environment.<br/><br/>Not for nothing, but why not simply concatenate the time to the date and name your folders that way. Just a thought.<br/><br/>Good luck. Thank you very much..... <br/><br/>Regards<br/>Paulwintech</p></body></html> | |
343. |
Solve : CIPHER command? |
Answer» <html><body><p>Hi all,<br/>Im kindof new to DOS commands. I started making a batch file that would encrypt a message for you by shifting each letter a few letters up, then i came across the <a href="https://interviewquestions.tuteehub.com/tag/cipher-419828" style="font-weight:bold;" target="_blank" title="Click to know more about CIPHER">CIPHER</a> command. I know it does not do the same thing and that it is supposed to encrypt files, but when i was messing around with it, i encrypted a few files and when i went to them nothing had changed.<br/><br/>What exactly does it <a href="https://interviewquestions.tuteehub.com/tag/mean-770507" style="font-weight:bold;" target="_blank" title="Click to know more about MEAN">MEAN</a> when it says its encrypting the file, or am i doing something wrong<br/><br/>Thankyoua quick overview of NTFS: <a href="http://www.pcguide.com/ref/hdd/file/ntfs/otherEncrypt-c.html">http://www.pcguide.com/ref/hdd/file/ntfs/otherEncrypt-c.html</a><br/><br/>Short story: Encryption is built into the NTFS file system. In order for a program to encrypt/decrypt a file, it merely needs to call EncryptFile() or DecryptFile().<br/><br/>The file data On-Disk is encrypted based on the current User's SID and the SID of any designated "recovery agents"; this means that the only way to decrypt the data is with a user that has one of those SIDs.<br/><br/>When you access an encrypted file- or more precisely, when any program accesses an encrypted file, unless they use special backup modes to access the actual encrypted data, the data is decrypted on the fly as the program reads from the file, by using the current user's SID. if the SID is unable to decrypt the file, an Access Denied Error occurs.<br/><br/>I am still a little unsure as to what the CIPHER command actually does. Are you saying that if i encrypt a file that another user on the same computer wont be able to see it? could you try to keep your answer a little simpler, because im quite new to all of this... Thanks Quote from: jpotts on November 15, 2010, 07:37:57 PM</p><blockquote>Are you saying that if i encrypt a file that another user on the same computer wont be able to see it? <br/></blockquote> <br/>No. I'm saying they won't be able to access it.<br/><br/> Quote from: BC_Programmer on November 15, 2010, 07:41:58 PM<blockquote>No. I'm saying they won't be able to access it.<br/></blockquote> <br/>Indeed. One thing that you can’t do with the Cipher tool that you can do through the GUI is give other users cryptographic access to encrypted files or folders. Windows XP and <a href="https://interviewquestions.tuteehub.com/tag/2003-243754" style="font-weight:bold;" target="_blank" title="Click to know more about 2003">2003</a> Server (unlike Windows 2000) allow the person who encrypts a file to <a href="https://interviewquestions.tuteehub.com/tag/add-361838" style="font-weight:bold;" target="_blank" title="Click to know more about ADD">ADD</a> other user accounts that enable others to view his/her encrypted data. This is done through the Encryption Details dialog box (accessed <a href="https://interviewquestions.tuteehub.com/tag/via-723599" style="font-weight:bold;" target="_blank" title="Click to know more about VIA">VIA</a> the Details button on the Advanced Attributes property sheet). There is no mechanism for doing this with the Cipher tool. Quote from: Salmon Trout on November 16, 2010, 12:23:18 AM<blockquote> There is no mechanism for doing this with the Cipher tool.<br/></blockquote> <br/>Windows 7 or vista added a /ADDUSER switch to cipher.</body></html> | |
344. |
Solve : using one router like the "GoToMyPC" technology? |
Answer» <html><body><p>all,<br/><br/>Would it be possible for me to connect to one computer that is connected to the same router as my requesting computer? What I want to do is use my one router that I have as a substitute for a LAN. I know that really can't be done technically, but I really want to work on, and modify files that are on my home machine in my living room, from my little netbook. Ideally I would be in my basement working on files that are located on my desktop upstairs.<br/><br/>Is this sort of thing possible? Both <a href="https://interviewquestions.tuteehub.com/tag/machines-550361" style="font-weight:bold;" target="_blank" title="Click to know more about MACHINES">MACHINES</a> would be connected to the same router, and according to the ISP, they do not recycle IPs at all, so the address would never change.<br/><br/>I have limited amount of knowledge about <a href="https://interviewquestions.tuteehub.com/tag/dos-432778" style="font-weight:bold;" target="_blank" title="Click to know more about DOS">DOS</a>, but I do understand how to connect to an <a href="https://interviewquestions.tuteehub.com/tag/ip-14828" style="font-weight:bold;" target="_blank" title="Click to know more about IP">IP</a>, ping them, FTP concepts, etc...<br/><br/>Any help from the gurus here would certainly be appreicated! Thanks so much! Quote from: ajetrumpet on November 20, 2010, 12:45:12 PM</p><blockquote>Would it be possible for me to connect to one computer that is connected to the same router as my requesting computer? <br/></blockquote> Of course.<br/><br/> Quote<blockquote>What I want to do is use my one router that I have as a substitute for a LAN. I know that really can't be done technically, <br/></blockquote> That's <a href="https://interviewquestions.tuteehub.com/tag/exactly-977868" style="font-weight:bold;" target="_blank" title="Click to know more about EXACTLY">EXACTLY</a> what it is; the computers connected to a router form a LAN. <br/><br/><br/>short story: you'd need to find the lan side IP address of the computers involved. My desktop, for example, is 192.168.0.100; obviously, this has nothing to do with connecting to the internet or anything outside the LAN; other network computers can see my desktop as that IP, but outside of the LAN it's meaningless.<br/><br/>Usually, there is 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> on the router setup pages where you can see the IP assignments within the LAN for each machine. Or, you can just use ipconfig; the IP address of your machine is the LAN-side address.</body></html> | |
345. |
Solve : "invalid drive specification"? |
Answer» <html><body><p>Hope this isnt a silly question...ive created an xp boot disk. after booting to it i type <a href="https://interviewquestions.tuteehub.com/tag/c-3540" style="font-weight:bold;" target="_blank" title="Click to know more about C">C</a>: to get to the c drive but all i get is "invalid drive specification".<br/><br/>other than this everything is fine, and the <a href="https://interviewquestions.tuteehub.com/tag/computer-243299" style="font-weight:bold;" target="_blank" title="Click to know more about COMPUTER">COMPUTER</a> boots ok. needles to say im doing this on an xp machine<br/><br/>how can i get to my c drive??<br/><br/>thankyou may need this kind of boot disk><a href="http://ntfs.com/boot-disk.htm">http://ntfs.com/boot-disk.htm</a>Or check out this <a href="https://interviewquestions.tuteehub.com/tag/url-11678" style="font-weight:bold;" target="_blank" title="Click to know more about URL">URL</a> www.bootdisk.com Quote from: mbeechwood on <a href="https://interviewquestions.tuteehub.com/tag/september-244232" style="font-weight:bold;" target="_blank" title="Click to know more about SEPTEMBER">SEPTEMBER</a> 12, 2004, 04:35:14 AM</p><blockquote>Hope this isnt a silly question...ive created an xp boot disk. after booting to it i type c: to get to the c drive but all i get is "invalid drive specification".<br/><br/>other than this everything is fine, and the computer boots ok. needles to say im doing this on an xp machine<br/><br/>how can i get to my c drive??<br/><br/>thank<br/></blockquote> Quote from: manishverma481 on <a href="https://interviewquestions.tuteehub.com/tag/november-243177" style="font-weight:bold;" target="_blank" title="Click to know more about NOVEMBER">NOVEMBER</a> 23, 2010, 12:38:03 AM<blockquote><br/></blockquote> Start a new thread and don't reopen threads that are almost seven years old.</body></html> | |
346. |
Solve : sync folders? |
Answer» <html><body><p>Hi, this is my first post here, so please forgive me if I have done something wrong (posted in the wrong place or i dunno) <br/><br/>for /r "%~d0\Music\" %%F in (*) do if not exist "C:\Users\Polle\Music\%%~nxF" del "%~d0\Music\%%~nxF"<br/><br/>So basically wath I'm trying to do is this: I'm trying to use this for command to find all files on my hard drive that are no longer on my computer and delete those files from my harddrive<br/><br/>Now, wath this command is doing: <br/>-It works correct in the folder "%~d0\Music"<br/>-It does nothing in the folder "%~d0\Music\someartisthere\"<br/><br/>example: it checks my <a href="https://interviewquestions.tuteehub.com/tag/hardrive" style="font-weight:bold;" target="_blank" title="Click to know more about HARDRIVE">HARDRIVE</a> and finds the file "%~d0\Music\ACDC\thunder.mp3"<br/>now on my pc it should look for "C:\Users\Polle\Music\ACDC\thunder.mp3"<br/>but it is looking for "C:\Users\Polle\Music\thunder.mp3" which does not exist<br/>so it will try to delete "%~d0\Music\thunder.mp3" wich does not exist either<br/><br/>nothing happens<br/><br/>Can anyone help me out on this one? More <a href="https://interviewquestions.tuteehub.com/tag/info-1043778" style="font-weight:bold;" target="_blank" title="Click to know more about INFO">INFO</a>, I gues I didn't make myself clear:<br/>I have an external HDD, and I want to make sure that if a file is no longer on my computer it is no longer on my external HDD either, I'm basicly trying to syncronize my external drive with my computer<br/><br/>heres the full script (it's mainly in dutch tough)<br/><br/><br/> Code: <a>[Select]</a>echo off<br/><br/>title = Folder Backup! (program by Polle)<br/>color 0e<br/>MKDIR %~d0\Muziek<br/>MKDIR %~d0\willekeurig<br/>MKDIR %~d0\games<br/>MKDIR %~d0\Vuze<br/>MKDIR %~d0\batch<br/>MKDIR %~d0\batch\special<br/>MKDIR %~d0\restore\registry<br/>cls<br/><br/><br/><br/><br/><br/>set /P backup= Backup van alles maken? (j/n) :<br/>if %backup% EQU j goto B<br/><br/>set /P muziek= Backup van muziek maken? (j/n) :<br/>set /P willekeurig= Backup van documenten maken? (j/n) :<br/>set /P GAMES= Backup van games maken? (j/n) :<br/>set /P Vuze= Backup van Vuze maken? (j/n) :<br/>set /P Batch= Backup van batch bestanden maken? (j/n) :<br/>set /P Registry= Backup van registry maken? (j/n) :<br/>goto A<br/><br/><br/><br/><br/>:A<br/><br/><br/>set start1=%time:~0,2%<br/>set start2=%time:~3,2%<br/>set start3=%time:~6,2%<br/>set starttime=%start1%:%start2%:%start3%<br/><br/><br/>title = making music backup... (program by Polle)<br/>if %muziek% EQU j xcopy /d /c /y "C:\Users\Polle\Music" "%~d0\Muziek"<br/>for /r "%~d0\Muziek\" %%F in (*.*) do if not exist "C:\Users\Polle\Music\%%~nxF" del "%~d0\Muziek\%%~nxF"<br/><br/>title = making documents backup... (program by Polle)<br/>if %willekeurig% EQU j xcopy /s /d /c /y "C:\Users\Polle\willekeurig" "%~d0\willekeurig\"<br/>for /r "%~d0\willekeurig\" %%F in (*.*) do if not exist "C:\Users\Polle\willekeurig\%%~nxF" del "%~d0\willekeurig\%%~nxF"<br/><br/>REM title = making games backup... (program by Polle)<br/>REM if %GAMES% EQU j xcopy /s /d /c /y "C:\Users\Polle\NDS games" "%~d0\games\NDS\"<br/>REM if %GAMES% EQU j xcopy /s /d /c /y "C:\Users\Public\Games\World of Warcraft\instal" "%~d0\games\WoW\"<br/>REM for /r "%~d0\games\NDS\" %%F in (*.*) do if not exist "C:\Users\Polle\NDS games\%%~nxF" del "%~d0\games\NDS\%%~nxF"<br/>REM for /r "%~d0\games\WoW\" %%F in (*.*) do if not exist "C:\Users\Public\Games\World of Warcraft\instal\%%~nxF" del "%~d0\games\WoW\%%~nxF"<br/><br/>title = making Vuze backup... (program by Polle)<br/>if %Vuze% EQU j xcopy /s /d /c /y "C:\Users\Polle\Vuze" "%~d0\Vuze\"<br/>for /r "%~d0\Vuze\" %%F in (*.*) do if not exist "C:\Users\Polle\Vuze\%%~nxF" del "%~d0\Vuze\%%~nxF"<br/><br/>title = making batch backup... (program by Polle)<br/>if %Batch% EQU j xcopy /s /d /c /y "C:\Users\Polle\Desktop\danger" "%~d0\batch\"<br/>if %Batch% EQU j xcopy /s /d /c /y /h "C:\Program Files\CwindowsMD" "%~d0\batch\special\"<br/>for /r "%~d0\batch\" %%F in (*.*) do if not exist "C:\Users\Polle\Desktop\danger\%%~nxF" del "%~d0\batch\%%~nxF"<br/>for /r "%~d0\batch\special\" %%F in (*.*) do if not exist "C:\Program Files\CwindowsMD\%%~nxF" del "%~d0\batch\special\%%~nxF"<br/><br/><br/>REM title = making registry backup... (program by Polle)<br/>REM if %Registry% EQU j xcopy /s /d /c /y "C:\regbackup" "%~d0\restore\registry\"<br/>REM for /r "%~d0\restore\registry\" %%F in (*.*) do if not exist "C:\regbackup\%%~nxF" del "%~d0\restore\registry\%%~nxF"<br/><br/><br/>set stop1=%time:~0,2%<br/>set stop2=%time:~3,2%<br/>set stop3=%time:~6,2%<br/>set stoptime=%stop1%:%stop2%:%stop3%<br/><br/>set /A result1=%stop1% - %start1%<br/>set /A <a href="https://interviewquestions.tuteehub.com/tag/result2-1187359" style="font-weight:bold;" target="_blank" title="Click to know more about RESULT2">RESULT2</a>=%stop2% - %start2%<br/>set /A result3=%stop3% - %start3%<br/>set resulttime=%result1%:%result2%:%result3%<br/><br/>cls<br/>echo start = %starttime%<br/>echo stop = %stoptime%<br/>echo duration = %resulttime%<br/>pause<br/><br/><br/>exit<br/><br/><br/><br/><br/><br/><br/>:B<br/>set muziek=j<br/>set willekeurig=j<br/>set GAMES=j<br/>set Vuze=j<br/>set Batch=j<br/>set Registry=j<br/>goto A<br/><br/><br/><br/>The non-functional parts are:<br/><br/>for /r "%~d0\Muziek\" %%F in (*.*) do if not exist "C:\Users\Polle\Music\%%~nxF" del "%~d0\Muziek\%%~nxF"<br/>for /r "%~d0\willekeurig\" %%F in (*.*) do if not exist "C:\Users\Polle\willekeurig\%%~nxF" del "%~d0\willekeurig\%%~nxF"<br/>for /r "%~d0\Vuze\" %%F in (*.*) do if not exist "C:\Users\Polle\Vuze\%%~nxF" del "%~d0\Vuze\%%~nxF"<br/>for /r "%~d0\batch\" %%F in (*.*) do if not exist "C:\Users\Polle\Desktop\danger\%%~nxF" del "%~d0\batch\%%~nxF"<br/>for /r "%~d0\batch\special\" %%F in (*.*) do if not exist "C:\Program Files\CwindowsMD\%%~nxF" del "%~d0\batch\special\%%~nxF"<br/><br/>It fails in the subdirectories of these foldersI 'm desperate! PLEASE, i BEG of you, can't anyone help me? <br/><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> an old post of someone that has a similar problem, he didn't find a solution either:<br/><br/> Quote</p><blockquote>Right now I've got a batch file to backup from My Documents to a <a href="https://interviewquestions.tuteehub.com/tag/networked-1114208" style="font-weight:bold;" target="_blank" title="Click to know more about NETWORKED">NETWORKED</a> drive at work. But I was wondering if there was a way to do this, but check to see if a file has been deleted. I have gotten rid of some files in my documents and they are still on my network drive. If I don't delete them from both at the same time I forget which ones they are.<br/>Anyway, I know this is possible with a 3rd party software, but I wanted to get it done throught his batch file if at all possible, since it is a work computer and I'm not supposed to install anything onto it </blockquote> Ok, It took me over 5 days, but I finally found a solution, well, a partial solution anyway, heres the new code for anyone that's interested:<br/><br/> Code: <a>[Select]</a>echo off<br/><br/>title = Folder Backup! (program by Polle)<br/>color 0e<br/>MKDIR %~d0\Music<br/>MKDIR %~d0\willekeurig<br/>MKDIR %~d0\Vuze<br/>MKDIR %~d0\batch<br/>MKDIR %~d0\CwindowsMD<br/>cls<br/><br/><br/><br/><br/><br/>set /P backup= Backup van alles maken? (j/n) :<br/>if %backup% EQU j goto B<br/><br/>set /P muziek= Backup van muziek maken? (j/n) :<br/>set /P willekeurig= Backup van documenten maken? (j/n) :<br/>set /P Vuze= Backup van Vuze maken? (j/n) :<br/>set /P Batch= Backup van batch bestanden maken? (j/n) :<br/>goto A<br/><br/><br/><br/><br/>:A<br/><br/><br/>set start1=%time:~0,2%<br/>set start2=%time:~3,2%<br/>set start3=%time:~6,2%<br/>set starttime=%start1%:%start2%:%start3%<br/><br/><br/>title = making music backup... (program by Polle)<br/>if %muziek% EQU j xcopy /d /c /y "C:\Users\Polle\Music" "%~d0\Music"<br/>for /r "%~d0\Music\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/><br/><br/><br/>title = making documents backup... (program by Polle)<br/>if %willekeurig% EQU j xcopy /s /d /c /y "C:\Users\Polle\willekeurig" "%~d0\willekeurig\"<br/>for /r "%~d0\willekeurig\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/><br/><br/><br/>title = making Vuze backup... (program by Polle)<br/>if %Vuze% EQU j xcopy /s /d /c /y "C:\Users\Polle\Vuze" "%~d0\Vuze\"<br/>for /r "%~d0\Vuze\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/><br/><br/>title = making batch backup... (program by Polle)<br/>if %Batch% EQU j xcopy /s /d /c /y "C:\Users\Polle\Desktop\danger" "%~d0\batch\"<br/>if %Batch% EQU j xcopy /s /d /c /y /h "C:\Program Files\CwindowsMD" "%~d0\CwindowsMD"<br/>for /r "%~d0\batch\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\Desktop\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/>for /r "%~d0\CwindowsMD\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Program Files\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/><br/><br/><br/>set stop1=%time:~0,2%<br/>set stop2=%time:~3,2%<br/>set stop3=%time:~6,2%<br/>set stoptime=%stop1%:%stop2%:%stop3%<br/><br/>set /A result1=%stop1% - %start1%<br/>set /A result2=%stop2% - %start2%<br/>set /A result3=%stop3% - %start3%<br/>set resulttime=%result1%:%result2%:%result3%<br/><br/>cls<br/>echo start = %starttime%<br/>echo stop = %stoptime%<br/>echo duration = %resulttime%<br/>pause<br/><br/><br/>exit<br/><br/><br/><br/><br/><br/><br/>:B<br/>set muziek=j<br/>set willekeurig=j<br/>set Vuze=j<br/>set Batch=j<br/>goto A<br/><br/><br/>It now finds and deletes 99% of the incorrect files, but it doesn't delete the incorrect folders<br/><br/>If anyone knows a similar solution to delete the folders, please tell, but for now, this is good enough for me<br/><br/>* NOTE: I did clean up the file a bit tough, so it's smaller, so it doesn't perfectly reflect the first file i posted *FINAL SOLUTION:<br/>this removes files AND directories<br/><br/>This finds all files that are on your external HDD but not on your home pc and erases them:<br/>note: I am comparing the folders "%~d0\Music\" (on my HDD) and "C:\Users\Polle\Music" (on my home PC)<br/><br/> Code: <a>[Select]</a>for /r "%~d0\Music\" %%F in (*.*) do echo %%F>> file.txt<br/>for /F "tokens=2* delims=\" %%I in (file.txt) do if not exist "C:\Users\Polle\%%I\%%J" del "%~d0\%%I\%%J"<br/>del file.txt<br/><br/>this will delete all remaining empty folders on my HDD:<br/><br/> Code: <a>[Select]</a>for /f "usebackq delims=" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"<br/></body></html> | |
347. |
Solve : Dos:Unable to call multiple bat files from single bat file? |
Answer» <html><body><p>I am trying to <a href="https://interviewquestions.tuteehub.com/tag/call-412416" style="font-weight:bold;" target="_blank" title="Click to know more about CALL">CALL</a> the bat file(main.bat) which contains 2 bat files(first, second and first bat files internally calls multiple bat files and outputs that to a file(also echos) and second bat file reads that file and calculates the total and echos back to the dos<br/>so when I execute the main bat file, it is executing the first bat file and giving the results, but the second bat file I dont see it is executing as it is not echoing any results.<br/><br/>Following is the code of the main bat file<br/><br/>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\old_Campaign_DB_Person al.bat --- first bat<br/>call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MAbatch\jobs\Count_db_pers.bat----second bat<br/><br/>Can some body please help me on this? <br/>In the code you posted, control is passed to the first batch script, but you did not use CALL, so therefore control will never return.<br/><br/>Thankyou..I have tried with the Call, but still it is not working.. following is the code for the bat files..<br/><br/>Following is the code of the first bat file...<br/><br/>setlocal<br/>REM *********************************************************<br/>REM * Rundate 'D'YYMMDD must be <a href="https://interviewquestions.tuteehub.com/tag/specified-1221578" style="font-weight:bold;" target="_blank" title="Click to know more about SPECIFIED">SPECIFIED</a> as first argument *<br/>REM *********************************************************<br/><br/>REM *********************************************************<br/>REM * Command-file must exist *<br/>REM *********************************************************<br/>FOR /R D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\ %%G IN (*.bat) DO start /b "call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/><br/><br/>set rc=%errorlevel%<br/>REM *******************************************************<br/>REM * Exit script and report return code *<br/>REM *******************************************************<br/>:done<br/>echo rc=%rc%<br/>exit /b %rc%<br/><br/>REM *******************************************************<br/>REM * Handle argument errors *<br/>REM *******************************************************<br/>:noargument<br/>echo Error: No argument specified<br/>set rc=2<br/>goto done<br/>:nopgm<br/>echo Error: Command file "%sch_command%" does not exist<br/>set rc=2<br/>goto done<br/><br/>Following is the code of the second bat file.<br/><br/>echo off & setLocal enableDELAYedexpansion<br/>set toterrors=<br/>set totjobs=<br/>for /f "tokens=1 delims= " %%a in (D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\count\count.txt) do (<br/>set /a toterrors+=%%a<br/>)<br/>for /f "tokens=2 delims= " %%b in (D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\count\count.txt) do (<br/>set /a totjobs+=%%b<br/>)<br/>echo total errors is !toterrors!<br/>echo total jobs is !totjobs!<br/>goto :eof <br/>I am sorry but you have a needlessly complicated problem.<br/><br/>You are using D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\<br/>Better to use<br/> Code: <a>[Select]</a>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\<br/>INFINITELY better to alter your problem and the code for which you need help by using<br/> Code: <a>[Select]</a>D:\DB_Personal\<br/>You seem to have a problem involving CALL and START.<br/>Why do you confuse the whole situation with the complication of<br/>FOR /R ...... %%G IN (*.bat) DO .....<br/><br/>Finally, this code fragment is ludicrously wrong<br/> Code: <a>[Select]</a>DO start /b "call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/><br/>As Sidewinder has already pointed out in your simultaneous topic on this same horrible code,<br/>you should use start or call, but not both.<br/>REGARDLESS of all the previous horrors, buried at the end of all the needless verbiage, is the SPACE character, i.e.<br/> Code: <a>[Select]</a>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/>I think you might have better luck with<br/> Code: <a>[Select]</a>"D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\%%G"<br/><br/>Alan<br/> Quote from: ALAN_BR on November 21, 2010, 10:02:35 AM</p><blockquote>You are using D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\<br/>Better to use<br/> Code: <a>[Select]</a>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\<br/>INFINITELY better to alter your problem and the code for which you need help by using<br/> Code: <a>[Select]</a>D:\DB_Personal\</blockquote> True, but chances are the file system arrangement is beyond their control. You can't just say "Because it is easier for me, everybody must store their files in this particular arrangement" in a company.<br/><br/> Quote<blockquote>Why do you confuse the whole situation with the complication of<br/>FOR /R ...... %%G IN (*.bat) DO .....<br/></blockquote> Probably because that was in his batch file.<br/><br/> Quote<blockquote>Finally, this code fragment is ludicrously wrong<br/> Code: <a>[Select]</a>DO start /b "call D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/><br/>As Sidewinder has already pointed out in your simultaneous topic on this same horrible code,<br/>you should use start or call, but not both.<br/></blockquote> It works fine. It looks like they were trying to run the various batch files asynchronously, but because /b was specified they all end up waiting on each other for the console anyway.<br/><br/> Quote<blockquote>REGARDLESS of all the previous horrors, buried at the end of all the needless verbiage, is the SPACE character, i.e.<br/> Code: <a>[Select]</a>D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\" %%G<br/>I think you might have better luck with<br/> Code: <a>[Select]</a>"D:\DAT\SAS\DMT\Lev1\SASMain\Data\MAMisc\MASched\jobs\DB_Personal\%%G"<br/></blockquote> it works either way.<br/> Quote from: BC_Programmer on November 22, 2010, 02:09:34 PM<blockquote>True, but chances are the file system arrangement is beyond their control. You can't just say "Because it is easier for me, everybody must store their files in this particular arrangement" in a company.<br/>Probably because that was in his batch file.<br/></blockquote> I accept that he cannot stipulate the paths that are used company wide,<br/>but he SHOULD have the ability to compose a very concise file path with which to explore how to call / start bat scripts.<br/><br/>I find extremely verbose scripts to be a pain and tend to obscure any tiny (but significant) code error.<br/><br/>I always prefer to have a small script with the one feature that does not work for me,<br/>and only after learning how to use it will I go back to the grand picture.<br/><br/> Quote<blockquote>it works either way.<br/></blockquote> Are you sure, or did you fail to spot the obscure error to which I drew attention ?<br/><br/>Please explain any error in my test and explanation which follows.<br/><br/>I have created TEST.BAT at location D:\DAT<br/>TEST.BAT code<br/> Code: <a>[Select]</a>echo This script is %0<br/><br/>I have used RUN and launched CMD.EXE and invoked TEST.BAT twice, with and without the extraneous space character, and selected and pasted the window contents below.<br/> Code: <a>[Select]</a>Microsoft Windows XP [Version 5.1.2600]<br/>(C) Copyright 1985-2001 Microsoft Corp.<br/><br/>C:\Documents and Settings\Dad>CALL D:\DAT\ TEST<br/>'D:\DAT\' is not recognized as an internal or external command,<br/>operable program or batch file.<br/><br/>C:\Documents and Settings\Dad>CALL D:\DAT\TEST<br/><br/>C:\Documents and Settings\Dad>echo This script is D:\DAT\TEST<br/>This script is D:\DAT\TEST<br/><br/>C:\Documents and Settings\Dad><br/>Regards<br/>Alan<br/> Quote from: ALAN_BR on November 22, 2010, 03:22:49 PM<blockquote>Are you sure, or did you fail to spot the obscure error to which I drew attention ?<br/><br/>Please explain any error in my test and explanation which follows.<br/><br/>I have created TEST.BAT at location D:\DAT<br/>TEST.BAT code<br/> Code: <a>[Select]</a>echo This script is %0<br/><br/>I have used RUN and launched CMD.EXE and invoked TEST.BAT twice, with and without the extraneous space character, and selected and pasted the window contents below.<br/> Code: <a>[Select]</a>Microsoft Windows XP [Version 5.1.2600]<br/>(C) Copyright 1985-2001 Microsoft Corp.<br/><br/>C:\Documents and Settings\Dad>CALL D:\DAT\ TEST<br/>'D:\DAT\' is not recognized as an internal or external command,<br/>operable program or batch file.<br/><br/>C:\Documents and Settings\Dad>CALL D:\DAT\TEST<br/><br/>C:\Documents and Settings\Dad>echo This script is D:\DAT\TEST<br/>This script is D:\DAT\TEST<br/><br/>C:\Documents and Settings\Dad><br/>Regards<br/>Alan<br/></blockquote> Works for me. Probably because I tested what he had and was executing, rather then a more bare case that essentially avoids any issue.<br/><br/>First, I created a bunch of batch files in D:\testbat, test1.bat through test9.bat, they simple contained:<br/><br/> Code: <a>[Select]</a>echo this is %0<br/><br/><br/><br/><br/>and then this one (in a separate folder)<br/><br/> Code: <a>[Select]</a>FOR /R D:\testbat\ %%G IN (*.bat) DO start /b "call D:\testbat\" %%G<br/><br/>and the output:<br/> Code: <a>[Select]</a><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test1.bat<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test10.bat<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test2.bat<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test3.bat<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test4.bat ♪◙<br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test5.bat<br/>this is D:\testbat\test1.bat<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test6.bat ♪◙<br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test7.bat<br/>D:\testbat>this is D:\testbat\test2.bat<br/><br/>this is D:\testbat\test10.bat<br/>D:\testbat>this is D:\testbat\test3.bat<br/>start /b "call D:\testbat\" D:\testbat\test8.bat<br/><br/>D:\testbat><br/><br/>D:\testbat>start /b "call D:\testbat\" D:\testbat\test9.bat<br/>D:\testbat><br/>D:\testbat><br/>D:\testbat>this is D:\testbat\test4.bat<br/>this is D:\testbat\test7.bat<br/><br/>D:\testbat>this is D:\testbat\test5.bat<br/>this is D:\testbat\test6.bat<br/><br/>D:\testbat><br/>D:\testbat>this is D:\testbat\test8.bat<br/><br/>D:\testbat><br/>D:\testbat>this is D:\testbat\test9.bat<br/><br/>which was certainly weird (what with the starts and the fact that the output was usually delayed and they had to wait for each other and all) but there were no syntax errors.<br/><br/><br/>On the other hand, when I said "it works either way" I was being disingenuous; truly, it doesn't work with the %%G in the quotes. In the first case (outside the quotes) start is using the quoted portion as the window title, and then executes the second part (the batch filename). Whether this was intended, I haven't a clue. Including the %%G within the quotes would cause an error, as it would then expand to start /b "call D:\testbat\D:\testbat\test9.bat" which clearly wouldn't work.<br/><br/>Also, I rather like the musical symbols that the batch throws in the output. adds a nice touch.<br/><br/>Thanks for the explanation.<br/><br/>I like your concise code, i.e.<br/> Code: <a>[Select]</a>FOR /R D:\testbat\ %%G IN (*.bat) DO start /b "call D:\testbat\" %%G<br/>I now see that "call D:\testbat\" is the title and not part of the command.<br/><br/>I was rather confused that the title was preceded by the argument /b.<br/>I thought the title was always first after the start.<br/><br/>It has been a long time since I used "FOR /R" and I wrongly guessed that %%G would be appending the name of each *.bat in the folder, so assumed the intention was <br/> Code: <a>[Select]</a>call "D:\very long path which MAY have spaces that need quotes\"%%Gin which case a space before the %%G would have broken the path<br/><br/>Question, what are the benefits and side effects of giving a title to a program with no window so no title <a href="https://interviewquestions.tuteehub.com/tag/bar-237951" style="font-weight:bold;" target="_blank" title="Click to know more about BAR">BAR</a> ?<br/>I have just created t.bat and started it with a title,<br/>it ran in the "DOS window" that invoked it and had no effect on the existing title bar,<br/>no effect whilst it was paused,<br/>no effect after it was ended.<br/> Code: <a>[Select]</a>C:\Documents and Settings\Dad>echo pause > t.bat<br/><br/>C:\Documents and Settings\Dad>start /b "a silly misleading title" t<br/><br/>C:\Documents and Settings\Dad><br/>C:\Documents and Settings\Dad>pause<br/>Press any key to continue . . .<br/>C:\Documents and Settings\Dad><br/><br/>Regards<br/>Alan<br/> Quote from: ALAN_BR on November 23, 2010, 05:23:44 AM<blockquote>I like your concise code, i.e.<br/> Code: <a>[Select]</a>FOR /R D:\testbat\ %%G IN (*.bat) DO start /b "call D:\testbat\" %%G</blockquote> Not sure if it's sarcasm... but in any case, I basically wanted to test what they had; so that I could see the same sort of behaviour. Upon seeing that it worked, it was possible to figure out why.<br/><br/> Quote<blockquote>I was rather confused that the title was preceded by the argument /b.<br/>I thought the title was always first after the start.<br/></blockquote> I don't think it really matters wether switches appear before or after; although they have to appear before the command (which in this case is %%G) (otherwise those switches will be sent to the command)<br/><br/><br/> Quote<blockquote>Question, what are the benefits and side effects of giving a title to a program with no window so no title bar ?<br/></blockquote> none... since the /b switch suppresses creating a new window, the title has no effect. I suspect the batch was only working entirely accidentally.<br/> Quote from: BC_Programmer on November 23, 2010, 05:28:24 AM<blockquote>Not sure if it's sarcasm... <br/></blockquote> Definitely not sarcasm.<br/>Short and all on one line, not long and wrapped to continue on following line. Simple to read.<br/>I admire your patience at testing every aspect of the original code.<br/><br/>I developed undying hatred of software verbosity when I inherited and had to correct code from vandals that <a href="https://interviewquestions.tuteehub.com/tag/moved-2846161" style="font-weight:bold;" target="_blank" title="Click to know more about MOVED">MOVED</a> away.<br/>They left me with 'C' code in which every line of code was up to 400 characters wide.<br/>When I scrolled to the last bug on a line, I could no longer see the previous 75% of the line.<br/>Partly the problem was that they chose to indent the code by increments of 8 characters and they had many levels of indentation,<br/>but mostly they chose NOT to document Global Variables with a comment upon the real purpose,<br/>and instead the variable was given a <a href="https://interviewquestions.tuteehub.com/tag/lengthy-2787497" style="font-weight:bold;" target="_blank" title="Click to know more about LENGTHY">LENGTHY</a> self documenting name. e.g. code such as<br/>Value_to_put_in_DAC_register_1 ^= Value_for_DAC_register_1 *= Scaling_Factor_for PAL_Colour - PAL_SECAM_OFFSET etc etc<br/><br/>Some of their code depended upon the "rules of precedence" for which there are ANSI standard rules,<br/>but the compilers in use were not quite compliant ! ! !<br/><br/>Regards<br/>Alan<br/></body></html> | |
348. |
Solve : Separate String with No Delimiters? |
Answer» <html><body><p>Is it possible to tokenize a given string, character by character, when no <a href="https://interviewquestions.tuteehub.com/tag/delimiters-947634" style="font-weight:bold;" target="_blank" title="Click to know more about DELIMITERS">DELIMITERS</a> are present? E.G., if the string contained "abcd" instead of "a,b,c,d".<br/><br/>Or, from the opposite way of thinking, is it possible to automatically insert delimiters into a string once per character?<br/><br/>Perhaps you would have to build the string, character by character using string manipulation on your input....but how could you automate string manipulation commands(:~x,y) to move/progress that way?Hi Greg.<br/><br/>Here's a start for you to improve on. The addition of the # char to the string is just to <a href="https://interviewquestions.tuteehub.com/tag/give-468520" style="font-weight:bold;" target="_blank" title="Click to know more about GIVE">GIVE</a> something to test for end-of-string and can be any character. The For loop is just to demo output.<br/><br/> Code: <a>[Select]</a>echo off<br/>cls<br/><br/>setlocal enabledelayedexpansion <br/><br/>set string=abcdefg#<br/>set pos=0<br/><br/>:start<br/> <a href="https://interviewquestions.tuteehub.com/tag/call-412416" style="font-weight:bold;" target="_blank" title="Click to know more about CALL">CALL</a> set chr=%%string:~%pos%,<a href="https://interviewquestions.tuteehub.com/tag/1-236780" style="font-weight:bold;" target="_blank" title="Click to know more about 1">1</a>%%<br/> if !chr!==# goto finis<br/> set var1=!var1!!chr!,<br/> set /a pos+=1<br/> goto start<br/><br/>:finis<br/>set var1=!var1:~0,-1!<br/><br/><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-%pos% delims=," %%A in ("%var1%") do (<br/> set var2=%%A%%B<br/> set var3=%%B%%F%%G<br/>)<br/>echo String Variable =%string:~0,-1%<br/>echo CSV string =!var1!<br/>echo Tokens=Pos=!pos!<br/>echo Var2=%var2%<br/>echo Var3=%var3%<br/><br/></p></body></html> | |
349. |
Solve : need batch file code to start a program minimized, "start /b /min" does not work? |
Answer» <html><body><p>my .bat file code:<br/><br/>start /b /min C:\"Program Files (x86)\<a href="https://interviewquestions.tuteehub.com/tag/aim-852223" style="font-weight:bold;" target="_blank" title="Click to know more about AIM">AIM</a>\aim.exe"<br/>start /b /min C:\"Program Files (x86)\Microsoft Office\OFFICE11\EXCEL.EXE"<br/><br/>result of opening the .bat:<br/>-AIM launches normally (not minimized )<br/>-Excel launches minimized<br/><br/>The obvious <a href="https://interviewquestions.tuteehub.com/tag/difference-240059" style="font-weight:bold;" target="_blank" title="Click to know more about DIFFERENCE">DIFFERENCE</a> here is that excel is MS <a href="https://interviewquestions.tuteehub.com/tag/based-389387" style="font-weight:bold;" target="_blank" title="Click to know more about BASED">BASED</a>, AIM is non-MS based...<br/>So how can I get AIM to start minimzed?problem 'semi-resolved' using .au3 files with AutoItV3EDIT:<br/><br/>To anyone who has a similar problem, I'm posting my <a href="https://interviewquestions.tuteehub.com/tag/solution-25781" style="font-weight:bold;" target="_blank" title="Click to know more about SOLUTION">SOLUTION</a>. Had to use force codes as AIM does not follow Windows API (required AutoItV3). Timer delay followed by an additional set state command was needed because the program would simply restore itself from the taskbar after a certain amount of time (). If anyone could actually help me write a code without the use of a timer delay, that would be great (: (like minimize after the program restores itself)<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>Run("C:\Program Files (x86)\AIM\aim.exe", "", SW_MINIMIZE)<br/>WinWait("AIM")<br/>WinSetState("AIM", "", SW_MINIMIZE)<br/>Sleep(5000)<br/>WinSetState("AIM", "", SW_MINIMIZE)</p></body></html> | |
350. |
Solve : change to a server drive in a BAT file? |
Answer» <html><body><p>in the RUN cmd I can <a href="https://interviewquestions.tuteehub.com/tag/type-238192" style="font-weight:bold;" target="_blank" title="Click to know more about TYPE">TYPE</a> \\myserver\d$ and it will direct me there.<br/>How to in a Batch .BAT <a href="https://interviewquestions.tuteehub.com/tag/file-11330" style="font-weight:bold;" target="_blank" title="Click to know more about FILE">FILE</a>?<br/>Thanks<br/>ADHyou can map a drive <a href="https://interviewquestions.tuteehub.com/tag/using-1441597" style="font-weight:bold;" target="_blank" title="Click to know more about USING">USING</a> the net use commandstart \\sername\d$ from batch file will open a explorer window and drive you there.<br/><br/>However you can use "<a href="https://interviewquestions.tuteehub.com/tag/pushd" style="font-weight:bold;" target="_blank" title="Click to know more about PUSHD">PUSHD</a>" or "net use" commands to map the folder internallly .<br/></p></body></html> | |