This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 6601. |
Solve : Backing up profile data? |
|
Answer» Hello again! |
|
| 6602. |
Solve : Enabling my cd rom for Dos? |
|
Answer» Was finally able to get the memory PROBLEMS taken care of after looking around for a bit today. It finally WORKED with dos=high,umb loaded before the himem.sys DEVICE line, and emm386.exe ram loaded after himem.sys. |
|
| 6603. |
Solve : Unable to open txt file using start command? |
|
Answer» My BATCH file operation is, My Batch file operation is, |
|
| 6604. |
Solve : getting stuck with rename scripts? |
|
Answer» I am trying to create a .bat that will move, rename (filename - date) and zip a number of files. I am trying to create a .bat that will move,copy, rename (filename - date) The rename above wouldhave produced duplicate names ( the system would not allow.) The following uses the ORIGINAL name as part of the following new name. ( now the name is too long. ). Play with it to reduce name size. GOOD luck. ) for /f "delims=" %%a in (arc.txt) do (ren "c:\batch\archive\%%a" "%%a %dd%%mm%%yy%.txt" ) C:\batch>kizzie.bat c:\batch\backup\liz1212.txt c:\batch\backup\liz1213.txt 2 file(s) copied. Date = Sun 12/13/2009 mm =12 dd =Su yy =2009 Volume in drive C has no label. Volume Serial Number is F4A3-D6B3 Directory of c:\batch\archive 12/13/2009 06:01 PM . 12/13/2009 06:01 PM .. 12/13/2009 12:25 PM 13 liz1212.txt 12/13/2009 12:25 PM 13 liz1213.txt 12/13/2009 12:25 PM 13 Su12 2009.txt 3 File(s) 39 bytes 2 Dir(s) 305,543,217,152 bytes free Volume in drive C has no label. Volume Serial Number is F4A3-D6B3 Directory of c:\batch\archive 12/13/2009 09:03 PM . 12/13/2009 09:03 PM .. 12/13/2009 12:25 PM 13 liz1212.txt Su12 2009.txt 12/13/2009 12:25 PM 13 liz1213.txt Su12 2009.txt 12/13/2009 12:25 PM 13 Su12 2009.txt Su12 2009.txt 3 File(s) 39 bytes 2 Dir(s) 305,543,213,056 bytes free C:\batch> p.s. A full path to the name ( for ren ) of the original file works best. The file with the new name must remain in the same folder. copy or xcopy are more versatile.Thankyou this second one worked great |
|
| 6605. |
Solve : help with a .bat file? |
|
Answer» Quote if *_std.idx( not sure what you think this will do? Anyhow, I use this modified version (changed line in blue) @echo off set thisdir=%cd% Echo Scanning subfolders for /f "delims=" %%D in ('DIR /b /ad') do ( echo Entering subfolder: %%D cd /d "%%D" Echo Renaming *_std to *_std.mpg if exist *_std ( for /f "delims=" %%S in ( ' dir /b *_std ^| FIND /v "_std.idx" ' ) do ( echo Renaming %%S to %%S.mpg ren "%%S" "%%S.mpg" ) ) ELSE ( echo *_std : no files to process ) Echo Renaming 2-* to 9-* to 02-* to 09-* for %%N in (2 3 4 5 6 7 8 9) do ( if exist "%%N-*" ( for /f "delims=" %%F in ('dir /b %%N-*') do ( echo Renaming %%F to 0%%F ren "%%F" "0%%F" ) ) else ( echo %%N-* : no files to process ) ) cd /d %thisdir% ) pause Quote from: xfusion on December 14, 2009, 12:48:20 PM then again, wouldn't this work? Why not give it a try? |
|
| 6606. |
Solve : bat file to copy files from folder with changing name YYYYMMDD? |
|
Answer» I am needing to write a bat file that copies files from a folder whose name changes daily and I need to copy those from YESTERDAYS folder. I.e. if TODAY is feb 12, 2010 i need to copy files from folder 20100211 and tomorrow I will need to copy from folder 20100212. Can anyone help me? THANKS in advanceOpen up the command prompt and type in Code: [Select]echo %date% then post what is displayed on the screen. We need to know this so we can make a code that works for your date format.it's : Sat 02/13/2010Watch out for the end-of-the-month...i could also approach this by copying contents of the most recent folder where folder name is like YYYYMMDD to a folder named current. Would this make it any more doable?pls answer helpmeh's question. pls answer helpmeh's question.Quote from: jonfrye on February 13, 2010, 10:16:53 AM it's : Sat 02/13/2010Quote from: Helpmeh on February 14, 2010, 03:19:35 PM Sorry I must be going blind. Anyhow, we don't really need the date format if we can use VBS. Code: [Select]@echo off Echo Wscript.echo eval(WScript.Arguments(0))>evaluate.vbs For /f "delims=" %%A in ('cscript //nologo evaluate.vbs "year(date-1)"') do set YYYY=%%A For /f "delims=" %%B in ('cscript //nologo evaluate.vbs "month(date-1)"') do set MM=%%B For /f "delims=" %%C in ('cscript //nologo evaluate.vbs "day(date-1)"') do set DD=%%C del evaluate.vbs if %MM% LSS 10 set MM=0%MM% if %DD% LSS 10 set DD=0%DD% set sourcefolder=%YYYY%%MM%%DD% set filespec=*.* set destinfolder=c:\whatever\whatever copy "%sourcefolder%\%filespec%" "%destinfolder%" Outstanding, thanks very much--I APPRECIATE it immensely.Quote from: Salmon Trout on February 14, 2010, 03:39:26 PM
this can be shortened (by combining the evals) so that you don't have to call cscript.exe engine 3 times. Quote from: ghostdog74 on February 14, 2010, 08:30:17 PM this can be shortened (by combining the evals) so that you don't have to call cscript.exe engine 3 times. Indeed. And you can eliminate the parameter passing altogether. Code: [Select]@echo off REM must use sign - or + set diff= -1 Echo Wscript.echo year(date%diff%) ^& "," ^& month(date%diff%) ^& "," ^& day(date%diff%)>datecalc.vbs For /f "tokens=1-3 delims=," %%A in ('cscript //nologo datecalc.vbs') do ( set YYYY=%%A set MM=%%B set DD=%%C ) del datecalc.vbs if %MM% LSS 10 set MM=0%MM% if %DD% LSS 10 set DD=0%DD% set foldername=%YYYY%%MM%%DD% |
|
| 6607. |
Solve : if exist bgr 100mb? |
|
Answer» I've a QUESTION. |
|
| 6608. |
Solve : Remotely create folder & copy files? |
|
Answer» Dear Experts, |
|
| 6609. |
Solve : string inside a sting? |
|
Answer» So I need to loop a 'choice /c ...' %B% amount of times, setting a new veriable each time it loops named p%b%. I got the pulling thing, but %p%b%% doesnt work, and neither does %%p%b%%%. I believe you have to do this with a for loop, but when I typed for /?, I had no clue what they were talking about. If anyone could walk me through one of these that would be GREAT! A workaround would be great too code below. Could not test your code beyond the ploop. Need more info about the exs files and their contents. Not sure why you want/need a choice statement in a for loop. Perhaps if you told us what you're trying to accomplish, we might better find a solution.I am attempting to create a password that does not show up on the screen, thus it would CLEAR out all input as soon as you enter it, that was why I was using choice /c. The p#.exs are just renamed text files that corrospond with the errorlevel of choice /c for the correct password. Would you mind expanding on the 'call a set' thing you were talking about? I have never heard of it before. Quote from: Squashman on June 11, 2012, 10:02:30 AM I think what you are trying to do is access an array variable. In which case you would need to use delayed expansion. Not sure what this is, but will look into it when I get home.Quote from: Lemonilla on June 11, 2012, 10:08:48 AM I am attempting to create a password that does not show up on the screen, thus it would clear out all input as soon as you enter it, that was why I was using choice /c. Check out this post for information on passwords and batch processing. The posted code will not run on a 64 bit OS. Have you considered VBScript or Powershell? More verbose to be sure but you'll have more secure results. Control-Break can circumvent any 'protections' made by way of a batch file....Quote from: BC_Programmer on June 11, 2012, 12:36:23 PM Control-Break can circumvent any 'protections' made by way of a batch file....Quote from: Sidewinder on June 11, 2012, 12:23:33 PM Check out this post for information on passwords and batch processing.Sorry to be the pessimist, but I believe you guys are TOTALLY missing the point of the program. It isn't for the sake of security, I could really just ASK him not to use my computer and problem solved. It's more for the practice programming and for learning new commands. Anyway, problem was fixed with a reorganization of code. Code: [Select]@echo off if exist stop.txt del /f stop.txt title extraSecurity set /p p#=<p.exs set b=0 :cloop title Letter Number:%b% set /a b+=1 choice /c 1234567890qwertyuiopasdfghjklzxcvbnmABCDEFGHIJKLMNOPQRSTUVWXYZ /n /cs /m "Password?" cls set /p p=<p%b%.exs IF %errorlevel% NEQ %p% goto exit if %b% EQU %p#% goto end goto cloop :end echo OK >>stop.txt if not exist stop.txt goto end exit :exit if exist stop.txt shutdown -s -f -t 1 if exist stop.txt exit goto exit |
|
| 6610. |
Solve : Problem: Dir output to file? |
|
Answer» I'm writing a program that utilizes the DIR command with the windows XP command prompt and ran into a problem... |
|
| 6611. |
Solve : Shortcut from batch?? |
|
Answer» Can A Batch File Posible Make A Shortcut? Can A Batch File Possible Make A Shortcut? Here is the easy way: Code: [Select]@echo off start Iexplore.exe http://www.pement.org/awk/awk1line.txt or the difficult way: C:\>type Awk.url Code: [Select][DEFAULT] BASEURL=http://www.pement.org/awk/awk1line.txt [InternetShortcut] URL=http://www.pement.org/awk/awk1line.txt IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2C:\ p.s.: KISS ( Keep It Simple Sam )Bill brings up a good point (although the VBS solution works wonders). .URL files are still shortcuts. If you use file:// instead of http:// then in theorey, you can use a web shortcut as a REGULAR shortcut. Quote [DEFAULT] Oh Man Its Awesome! It Works! |
|
| 6612. |
Solve : Changing to a usb drive when you do not know the drive letter? |
|
Answer» My question is how can I change to the drive letter of my usb drive when I do not know the drive letter it is ASSIGNED to? |
|
| 6613. |
Solve : html batch? |
|
Answer» I need a way to retrieve html from a specific webpage WITH BATCH, and then parse it through the batch file. Any ideas?http://www.chami.com/tips/windows/062598W.html "First, download and INSTALL URL2File Windows Application, which is the program we'll be using in this example (URL2File Windows Application is a product of Chami.com). URL2File can retrieve and save the content of a given World Wide Web URL to a local file. So, to retrieve the web page at http://www.chami.com/tips/ and save it to a local file named tips.htm, run the following command from a Windows Command Prompt/DOS Box: Quote I need a way to retrieve html from a specific webpage WITH BATCH, and then parse it through the batch file. Any ideas? I doubt you can do this with batch UNLESS you run a Windows script out of a batch file. The previous post suggested a download, but that program will download the web page, not the HTML source. This little snippet can be saved and then run from a batch file: Code: [Select]Const url="http://www.yahoo.com/" Set http = CreateObject("Microsoft.XMLHTTP") Set fso = CreateObject("Scripting.FileSystemObject") On Error Resume Next http.open "Get", url, False http.send "" If Err.Number <> 0 Then WScript.Echo "Error: " & Err.Number & ": " & Err.Description WScript.Quit End If Set f = fso.CreateTextFile("Html.txt", True) f.WriteLine http.responseText Change the URL to whatever. The HTML source will be saved in a file named HTML.txt Save the script with a VBS extension. You can put this reference in your batch file to execute the script: cscript scriptname.vbs Good luck. PS. I'll leave it to you to parse the HTML code in your batch file, but it might be a whole lot easier to WRITE the entire project in VBScript. |
|
| 6614. |
Solve : Execute batch script depending on no. files in folder? |
|
Answer» Hello everybody, the code fragment to get the count of files in a folder:Not sure if that works, but this should do the trick. Dir /b FOLDERNAME>dir.txt for /f %%a in (dir.txt) do set /a count+=1 echo Number of files in the folder is %count%. Pause > nulQuote from: Pupli on February 09, 2010, 02:45:59 AM Number of files stored in a particular folder ? C:\batch>type countfiles.bat Code: [Select]@echo off dir *.txt | wc -l Output: C:\batch>countfiles.bat 101 files C:\batch> p.s. We need to see the code for "C:\Dir1\job.bat" in order to modify to use the above count information. Quote from: Pupli on February 09, 2010, 02:45:59 AM Number of files stored in a particular folder? NAME wc -l (line count ) - lines in files SYNOPSIS wc [OPTION]... [FILE]... DESCRIPTION Print byte, word, and newline counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -, read standard input. -l, --lines print the newline counts http://linux.about.com/library/cmd/blcmdl1_wc.htmwc is a very good Linux/Unix utility but in view of the fact that the OP says Quote I have this .bat script and POSTED in an "MS-DOS" forum, I think they would be well advised to get a version compiled for Win32, for example the one contained in the excellent GNU Core Utils. Code: [Select]Dir /b FOLDERNAME>dir.txt for /f %%a in (dir.txt) do set /a count+=1 echo Number of files in the folder is %count%. Pause > nul Yes HELPMEH , This snippet of code, will do the trick. But, what if we want to test the %count% variable??? For example: Code: [Select]Dir /b particular_Folder>dir_p_f.txt for /f %%a in (dir_p_f.txt) do set /a count+=1 if %count%==0 ( echo.>> FolderCounter.log No files FOUND in the specified folder move FolderCounter.log Dir1) for /L %%b in (1 1 %count%) do call test.bat %%b echo.>> FolderCounter.log %count% files werre loaded move FolderCounter.log Dir1 I think that: this piece of code: echo.>> FolderCounter.log %count% files werre loaded move FolderCounter.log Dir1 after: for /L %%b in (1 1 %count%) do call test.bat %%b will prevent the FOR loop being executed correctly. I am right For /l %%b in (1,1,%count%) do ... Just a little mistake. No biggie. Can you please tell me the difference Quote (1,1,%count%) vs. (1 1 %count%)Becouse, it keeps executing fine in both ways !!! P.S. ...and what about the IF condition inside the FOR loop, ... am I coding it the right way? Thnx, PupliQuote from: Pupli on February 10, 2010, 05:22:45 AM Can you please tell me the difference No difference. The documentation shows a comma but in fact it works with just a space. Quote and what about the IF condition inside the FOR loop, ... am I coding it the right way? It isn't inside a loop. Quote It isn't inside a loop. Oh no, So, I have conditioned nothing regarding %count%==0 Can anyone help? Quote I just want my batch to test if %count%==0, and if true, just generate a .log file to explain this, and after it, exit (suspend execution) Can it be: Code: [Select]dir /b /a-d particular_Folder>dir_p_f.txt for /f %%a in (dir_p_f.txt) do (set /a count+=1) if %count%==0 ( echo.>> FolderCounter.log No files found in the specified folder move FolderCounter.log Dir1 ) else ( for /L %%b in (1 1 %count%) do call test.bat %%b echo.>> FolderCounter.log %count% files werre loaded move FolderCounter.log Dir1 ) Is this code a valid batch script language? Code: [Select]dir /b /a-d particular_Folder>dir_p_f.txt set count=0 for /f %%a in (dir_p_f.txt) do (set /a count+=1) if %count% EQU 0 ( echo No files found in the specified folder>>FolderCounter.log ) else ( for /L %%b in (1 1 %count%) do call test.bat %%b echo %count% files were loaded>>FolderCounter.log ) move FolderCounter.log Dir1 Tidied up a bit; corrected spelling of 'were'. Thank you Salmon Trout, Thnx again |
|
| 6615. |
Solve : Dos command to disconnect from server drive? |
|
Answer» When I boot up every morning at work on my Windows XP Pro SP2 computer, 15 different network drives are loaded. Using Windows Explorer, I right click and disconnect from the unneeded drives. Is there a Dos command for disconnecting network drives? Quote "To disconnect a network drive from a DOS PROMPT (in this case drive N:) run the following http://www.tiplib.com/140/disconnect-network-drive-command-prompt Works like a CHARM. I'll put it in a batch file. Thanks. |
|
| 6616. |
Solve : building new dos drive for old 486 computer? |
|
Answer» I have and old 486 computer and ONE day the bios just stops seeing the 40gb hard drive. It has an old Award bios that isn't SUPPOSED to be able to see such a large drive. I have no idea how the computer worked with the larger drive but it did. I can boot an old QNX 500mb drive so I know the computer is ok. I'm not at the point of TRYING to flash the bios YET since it has some sort of custom made Andron 486 CPU card. I have created and formated a 500mb partition on an old drive. The bios can see it ok and I can also see the drive on an old NT desktop I have. I would like to create an image of the old hard drive partition. However the old drive partition is 2gb of which 300mb is used. The question is can I create an image of the old drive that is about 500mb so it will fit on my newly created drive?You will need to use a drive overlay software ...usually from the drive manuf. to utilize that 40G drive in a DOS enviornment... |
|
| 6617. |
Solve : Im a noob and i need help ;D? |
|
Answer» Hi im a noob to this.. What is the purpose of all this? Aha... Quote Use Hotspot Shield to access US-only websites like Hulu and Pandora How does this fit with CH policy? yes tahts the purpose anyway is there a way to make my scriopt better and faster the true purpuse of this script is to learn batch file commands (hands on) heres the script again: Code: [Select] @echo off IF EXIST "C:\Program Files\Hotspot Shield\bin\openvpntray.exe" GOTO Prolaz Echo building script.vbs :: starting script for downloading hotspot shield echo ' Set your settings >> script.vbs echo strFileURL = "http://software-files-l.cnet.com/s/software/11/19/85/99/HSS-1.37-install-anchorfree-76-conduit.exe?e=1265484555&h=a7e834c8e32b71f4a970c846b7c635fd&lop=link&ptype=1901&ontid=2092&siteId=4&edId=3&spi=3693f3a32b3f47048deaa17f4ce8ff2b&pid=11198599&psid=10594721&fileName=HSS-1.37-install-anchorfree-76-conduit.exe" >> script.vbs echo strHDLocation = "D:\HSS-1.37-install-anchorfree-76-conduit.exe" >> script.vbs echo. >> script.vbs echo ' Fetch the file >> script.vbs echo Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP") >> script.vbs Echo. >> script.vbs echo objXMLHTTP.open "GET", strFileURL, false >> script.vbs echo objXMLHTTP.send() >> script.vbs echo. >> script.vbs echo If objXMLHTTP.Status = 200 Then >> script.vbs echo Set objADOStream = CreateObject("ADODB.Stream") >> script.vbs echo objADOStream.Open >> script.vbs echo objADOStream.Type = 1 'adTypeBinary >> script.vbs echo. >> script.vbs echo objADOStream.Write objXMLHTTP.ResponseBody >> script.vbs echo objADOStream.Position = 0 'Set the stream position to the start >> script.vbs echo. >> script.vbs echo Set objFSO = Createobject("Scripting.FileSystemObject") >> script.vbs echo If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation >> script.vbs echo Set objFSO = Nothing >> script.vbs echo. >> script.vbs echo objADOStream.SaveToFile strHDLocation >> script.vbs echo objADOStream.Close >> script.vbs echo Set objADOStream = Nothing >> script.vbs echo End if >> script.vbs echo. >> script.vbs echo Set objXMLHTTP = Nothing >> script.vbs Echo. >> script.vbs Echo. >> script.vbs echo Skript.vbs napravljena :: script .vbs for downloading hotspot complete echo Connecting to cnet and downloading instalation file hotspot shield ping localhost -n 2 >nul start/wait script.vbs ping localhost -n 2 >nul echo starting instalation for hotspot ping localhost -n 2 >nul cls echo 1. you will get a popup for instalation of hotspot. echo Hotspot shield je program za spajanje na VPN mrezu, koja u ovom slucaju se ponasa kao proxy. Proxy trebas iz razloga sto pandora.com odbija sve zemlje osim amerike echo nakon sto zavrsis ovaj dio, vise se ovo nece ponavljati, dok ne izbrises hotspot shield echo 2. Odaberi jezik instalacije echo 3. Pritisni next echo 4. pritisni I Agree/slazem se echo 5. pritisni next echo 6. skini kvacicu sa include toolbar( netreba ti to) i pritisni next echo 7. odaberi direktorij za instalaciju (mora bit C:\Program files, tamo ce pandora.bat trazit) echo 8. pritisni install "D:\HSS-1.37-install-anchorfree-76-conduit.exe" cls echo. echo congrats you sucesfuly installed hotspot ping localhost -n 3 >nul echo jos jedna vazna stvar... echo hotspot se financira od reklama, i jako su iritantni sa svojim reklamama, echo preporucujem da odes na https://addons.mozilla.org/en-US/firefox/ echo i instaliras si adblock plus (filter za REKLAME) echo i preplatis/subscribe se na en us listu echo. echo and thats that del D:\HSS-1.37-install-anchorfree-76-conduit.exe del script.vbs pause :Prolaz Echo hotspot installed mode con:cols=60 lines=8 echo 1.build pandora htm echo ^<html^>^<head^>^<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.pandora.com"^>^<head/^>^<body^>^<body/^>^<html/^> > pandora.htm echo 2.start hotspot start/min "" "C:\Program Files\Hotspot Shield\bin\openvpntray.exe" echo 3. korak cekaj 45 sekundi :: original script ia as you can see in croatian, the animation counts down... echo 45 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 44 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 43 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 42 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 41 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 40 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 39 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 38 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 37 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 36 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 35 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 34 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 33 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 32 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 31 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 30 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 29 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 28 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 27 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 26 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 25 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 24 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 23 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 22 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 21 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 20 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 19 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 18 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 17 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 16 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 15 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 14 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 13 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 12 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 11 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 10 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 9 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 8 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 7 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 6 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 5 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 4 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 3 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 2 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 1 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo. echo 0 \ ping localhost -n 2 >nul cls :: starting of pandora.htm start/min pandora.htm echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 15 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 14 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 13 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 12 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 11 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 10 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 9 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 8 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 7 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 6 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 5 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 4 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 3 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 2 / ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 1 - ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo. echo 0 \ ping localhost -n 2 >nul cls echo 1.korak napravi pandora.htm ^-znaci ignoriraj echo 2.korak otvori hotspot shield echo 3.korak cekaj 45 sekundi echo 4.korak pokreni pandoraradio.htm echo 5.korak izbrisi pandora.htm :: deliting pandora.htm del pandora.htm echo. echo. echo closing down ping localhost -n 5 >nul exit |
|
| 6618. |
Solve : How to dump text and lines displayed in CMD to a text file? |
|
Answer» Hi, |
|
| 6619. |
Solve : Scheduling a batch file execution? |
|
Answer» Hello everybody, "He suggested, I better make use of AT Command." rem at 2:15PM /interactive /every:date C:\Dir1\bat_File.bat rem the interactive option will not allow to run a 2AM automaticallly rem at /? C:\Dir1>type bat_File.bat echo Hello at command > c:\Dir1\bat_File.txt C:\Dir1> Code: [Select]C:\Dir1>at 9:51am c:\Dir1\bat_File.bat Added a new job with job ID = 1 C:\Dir1>at Status ID Day Time Command Line ------------------------------------------------------------------------------- 1 Today 9:51 AM c:\Dir1\bat_File.bat C:\Dir1>dir Volume in drive C has no label. Volume Serial NUMBER is F4A3-D6B3 Directory of C:\Dir1 02/08/2010 09:51 AM . 02/08/2010 09:51 AM .. 02/08/2010 09:49 AM 0 at 02/08/2010 09:48 AM 44 bat_File.bat 02/08/2010 09:51 AM 19 bat_File.txt 02/08/2010 09:49 AM 0 CLS 4 File(s) 63 bytes 2 Dir(s) 300,503,519,232 bytes free C:\Dir1>type bat_file.txt Hello at command C:\Dir1>Quote rem the interactive option will not allow to run a 2AM automaticallly Is that supossed to mean that removing the interactive option from the code, I can have my bat_File.bat executed periodically on daily basis at 2:15PM by making use of: Code: [Select]at 2:15PM /every:date C:\Dir1\bat_File.bat It just doesn't work. Well, of course ... It really works if I just schedule it at a specific time, but just for today It will need another "manual" schedulation the next dayI have not had a problem using Schedule Tasks. Why not try it and see if it works for you? You can read all about the AT command here. You can use the interactive switch to allow the task to interact with the DESKTOP of the user who is logged on at the time the task runs. The every switch is used for either days of the month or days of the week (M,T,W,Th,F,S,Su). Note: jobs put on the schedule by the Scheduler GUI cannot be seen by the AT command. Jobs put on the schedule by the AT command can be seen by the Scheduler GUI. Good luck. Quote from: Pupli on February 08, 2010, 10:32:19 AM Code: [Select]at 2:15PM /every:date C:\Dir1\bat_File.batThank you, to all of you Finally, I got my job scheduled: Code: [Select]AT 09:00AM /INTERACTIVE /EVERY:m,t,w,th,f,s,su C:\Dir1\job.bat Now, I have a final question: I am loged as a local administrator in my machine, and I scheduled my job, Now, what does it actually mean: Quote Note: jobs put on the schedule by the Scheduler GUI cannot be seen by the AT command. Jobs put on the schedule by the AT command can be seen by the Scheduler GUI.Is this supposed to mean, that I can see it as a process in task manager? Quote Note: jobs put on the schedule by the Scheduler GUI cannot be seen by the AT command. Jobs put on the schedule by the AT command can be seen by the Scheduler GUI. No. It means if you run the AT command with no parameters, only jobs put on the schedule with the AT command will appear in the list. If you bring up the GUI scheduler (start==accessories==>system tools==>scheduled tasks), you will see tasks scheduled with the AT command and the jobs scheduled manually with the GUI. You are scheduling a bat file, the task manager will show cmd.exe executing when the job executes, not the name of the batch file. The cmd shell is required for all batch files as it is the interpreter for the batch code. Quote I am loged as a local administrator in my machine, and I scheduled my job, Nothing in particular. The job will get the same permissions that the local administrator has. The local administrator name should show up in the task manager as the user name when the job runs. Question: why did you use the AT command and not the GUI? Quote Question: why did you use the AT command and not the GUI? Because a friend of mine told me that for jobs that need to be executed just once a day I'd better make use of the AT command. He also told me that I'd be capable to "control" it while it runs. (as I have used some pause commands thruoghout the code Now, will you allow me to ask you: What did you think I'll ever prefer the AT commands rather then GUI? Quote What did you think I'll ever prefer the AT commands rather then GUI? Actually I didn't. Quote Because a friend of mine told me that for jobs that need to be executed just once a day I'd better make use of the AT command. Did your friend explain why? Either way is fine. In fact the AT command can be used in a batch file as the target of an if statement where you can schedule a job if a certain condition is TRUE (or false). In any case, they're better than a Windows script where you have to account not only for the time but the offset from GMT. All, It would be great if i get a help from anyone to know how to execute a .pl script from batch file. 1. My perl script look for 3 arugment on command line eg: g:\app\scriipts>abc.pl -Year2009 Month01 -useconfig.cfg 2. I have to make the batch file with the below logic. Have to cut the year alone from command "date \T" Have to cut the month from the command "date \T" and need to do -1 from the current month Please let me know if you need anymore clarifiactions on my request. Quote from: aarruunnmd on February 10, 2010, 10:42:22 AM 2. I have to make the batch file with the below logic. C:\batch>type datet.bat Code: [Select]@echo off for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set year=%%c echo year=%year% pause for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set month=%%a for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set day=%%b set TODAY=%year%-%month%-%day% rem echo %TODAY% echo. echo. echo The following commands build the 'date variable' called "TODAY". echo. echo for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set year=%%c echo for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set month=%%a echo for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set day=%%b echo set TODAY=%%year%%-%%month%%-%%day%% echo. echo Now ... TODAY = %TODAY% echo. Output: C:\batch> datet.bat year=2010 Press any key to continue . . . The following commands build the 'date variable' called "TODAY". for /f "tokens=2-4 delims=/ " %a in ('date /T') do set year=%c for /f "tokens=2-4 delims=/ " %a in ('date /T') do set month=%a for /f "tokens=2-4 delims=/ " %a in ('date /T') do set day=%b set TODAY=%year%-%month%-%day% Now ... TODAY = 2010-02-10 C:\batch>Quote from: aarruunnmd on February 10, 2010, 10:42:22 AM All,if you want to cut this and that from the date command, that means you are trying to getting current time correct? Then do it inside your Perl script since you are already using it! Why do you want to use crappy batch (cmd.exe) for that , especially when it comes to dealing with date !? There are various date modules you can use with Perl for date maths, one of them is DateTime. Some others are Date::Calc etc. |
|
| 6620. |
Solve : This works but i'm sure there's a shorter (correct) way.? |
|
Answer» Hey guys, the object is to play a wav file in media player the closing and invisibility of wmplayer were the parts of the batch i was more curious about. By opening chimes.wav, you are presumably opening wmplayer indirectly thru the file association. You need to send a start /MIN parameter directly to the player. Code: [Select]@echo off Start /min wmplayer C:\chimes.wav ping -n 38 127.0.0.1 >NUL tskill wmplayer exit Don't worry about the sleep command (it comes with the Win2003 toolkit). Ping is perfectly serviceable. thanks a lot SIDEWINDER, APPRECIATE it |
|
| 6621. |
Solve : adding lines to a output text file? |
|
Answer» I WANT to add line1 line2 line3 hard coded in the batch file to a text file. I need crlf after each line. for /F "delims==" %%A in (c:\abcftp\list.txt) do What do you expect this line to do? I want to be able to start with push/pull:push and add each line to a text file on a separate line. The var %%A is the file name and is also plugged into the text where it says filename=%%A. The script works but the text to the file is on one line. thanks muchThis line does nothing for /F "delims==" %%A in (c:\abcftp\list.txt) do for /F "delims==" %%A in (c:\nameftp\list.txt) do echo push/pull:push remotedirectoryname:ABC\EntryB\ filename:%%A remoteserverIP:123.123.123.5 userID:abcid passwd:password emailaddr:[emailprotected] newfilename: >> c:\ABCftp\%%A.xfr This works but it put everything on one line in the text file. I want it on separate lines in the text file. How do you add crlf or how do you write it to add each group on a line. example push/pull:push remotedirectoryname:ABC\Entry\Filename:%%A remoteserverip:123.123.123.5 the FOR command has 2 forms 1. SINGLE line for [...] %%V in (something) do [command] 2. Multiple line - NOTE parentheses! for [...] %%V in (something) do ( [command] [command] [command] [command] ) So... dir /B /O:n > c:\abcftp\list.txt for /F "delims==" %%A in (c:\abcftp\list.txt) do ( echo push/pull:push > c:\abcftp\%%A.xfr echo remotedirectoryname:abc\EntryB\ >> c:\abcftp\%%A.xfr echo filename:%%A >> c:\abcftp\%%A.xfr echo remoteserverIP:123.123.12.43 >> c:\abcftp\%%A.xfr echo userID:abcftpid >> c:\abcftp\%%A.xfr echo passwd:abctflhd >> c:\abcftp\%%A.xfr echo emailaddr:[emailprotected] >> c:\abcftp\%%A.xfr echo newfilename: >> c:\abcftp\%%A.xfr ) thank you it works |
|
| 6622. |
Solve : batch file to upload PDF to dev server? |
|
Answer» Hi all, |
|
| 6623. |
Solve : Batch Script not properly working --- Assign value to a variable ???? |
|
Answer» Hello everybody, |
|
| 6624. |
Solve : help with a batch file? |
|
Answer» how to make batch FILE that start when i LOG in on my pc?Put it in your Start Menu startup folder. |
|
| 6625. |
Solve : Random words in batch?? |
|
Answer» Hey ppl, Im sorry but could u please explain it? For example, what i am supposed to write in list.txt? And how does it work?So, I will start off explaining what NEEDS to be in list.txt. This is what you could put in list.txt Quote 1 Word1 Now, I will re-post the script, with comments explaining how the code works. @echo off rem Turns echoing commands on-screen to off. set /a rnd=%random%%%10 rem Gets a random number from 1-10. for /f "tokens=1,2" %%a in (list.txt) do if %rnd%==%%a echo %%b rem Taking the first two tokens of each line in list.txt delimited by spaces, rem it will check if the first word is the same as the random number, and if it is, rem it will display the SECOND word. rem pauseOh, ok I get it now. Thanks a lot, problem solved! |
|
| 6626. |
Solve : batch file for streaming using VLC Media Player? |
|
Answer» How can I STREAM/multicast a video file using VLC MEDIA Player using BATCH file? |
|
| 6627. |
Solve : Problem on If exist...? |
|
Answer» This is my code: @echo offI want to CHECK if the folder is there... but i don't know the code ...Quote if exist /BGMBackup/ goto :continue else goto :backup The line above should be expressed like this. if exist "\BGMBackup\" (goto :continue) else (goto :backup) Your code creates folders in the current directory but then copies file EXPLICITLY to ROOT folders. That's a recipe for failure. Change the MD commands so they create root folders too. |
|
| 6628. |
Solve : Verify Directory? |
|
Answer» I have this batch: |
|
| 6629. |
Solve : Searching for specific string in previous command output and using in next cmd? |
|
Answer» Hi All I forgot to mentioned, I'm using ImageMagick to do the conversion from command line. Quote C:\>for /?Quote from: Chaka on July 12, 2012, 02:40:15 AM I forgot to mentioned, I'm using ImageMagick to do the conversion from command line. Sorry to put you through that: just realized Code: [Select]convert icon1.ico -format "%s %wx%h" info: | find "%a% 128x128" was interchangable with Code: [Select]identify icon1.ico | find "icon1.ico[%a%] ICO 128x128" |
|
| 6630. |
Solve : Places utility with variables? |
|
Answer» Quote from: Squashman on June 30, 2012, 04:48:29 PM It would be really great if you could actually shows us the output of this following from the command prompt. The screenshot with the command line [year+ old attachment deleted by admin]I'll for your advice after revising the screenshots Best Regards There is no need to post screen shots for the output of the CMD line or batch files. You can copy and paste the text from the cmd window into the forums. Posting an image just consumes more resources.this should work in spanish but if there is an option to put the month in three letter version then change jan feb mar, etc to the spanish version in the script below: @echo off&SetLocal EnableDelayedExpansion&goto :start :GetDate [EnVar] echo.GetDate [EnVar] Sets date into environment variable, EnVar as: dd-mm-aaaa echo.Usage: GetDate dma^&set ymd=%%errorlevel%%, ^(use %% rather than ^^! in command line) echo.Usage: GetDate dma^&set ymd=^^!errorlevel^^!, ^(use ^^! rather than %% in script^) echo.If no argument passed it echo's the date in dd-mm-aaaa format echo.Returns aaaammdd in errorlevel regardless if Envar is passed as argument or not echo.Works on NT/2K/XP/Vista/Win7 machines independent of most regional date settings EndLocal&exit /b :start set P1=%~1&if /i "!p1!" equ "/?" goto :GetDate if /i "%date%A" lss "A" (set toks=1-3) else (set toks=2-4) for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('date^ for /f "tokens=%toks% delims=.-/ " %%d in ('date/t') do ( set %%a=%%d&set %%b=%%e&set "%%c=%%f" ) ) if /i "%mm:~0,1%" gtr "9" CALL :month_convert mm if /i 1%mm% lss 20 set "mm=0%mm%" if /i %aa% lss 100 set "aa=20%aa%" if defined p1 ( Endlocal call set "%~1=%dd%-%mm%-%aa%"&exit /b %yy%%mm%%aa% ) EndLocal&echo.%dd%-%mm%-%aa%&exit /b %yy%%mm%%dd% :month_convert set "months=Jan Feb Mar Apr May Jun Jul Aug Sep Oct NOV Dec" call set "month=%%%~1%%" set/a mnum=0 for %%m in (%months%) do set/a mnum+=1&if /i %month% equ %%m call set "%~1=!mnum!"&exit /bQuote from: carlsomo on July 08, 2012, 11:37:30 PM this should work in spanish but if there is an option to put the month in three letter version then change jan feb mar, etc to the spanish version in the script below: I'll try . Best Regards |
|
| 6631. |
Solve : ping not responding in batch? |
|
Answer» Sorry to flood the forums (something like 4th thread in a month >.<), but my script SEEMS to stall on a certain command and I'm not sure why. I TRIED retyping the command into cmd and it worked, but when I try to run the script it stops on the command and just sits there. Any idea's? You code shows a label called break.rename but does it exist? I made the change, and also added the echo %c% you did for testing, but it never echoed. Thank you for the response.Does %y% expand to a meaningful ip or host name? Host name, in the case of the stall 'LEMONILLA' which is the host computer.You are trying to ping localhost using its network name? To test this try changing this ping %y% -n 1 | find "Min" >>ping%c%.1 to this ping %y% -n 1 pause and watch it to see what the error message is.That seems to be the problem :/ I'm not actually getting an error. Code: [Select]C:\Users\andude3\Documents\bat>( set /a c+=1 echo NATHANSCHOOL 1>>net!c!.1 ) C:\Users\andude3\Documents\bat>set m=2 C:\Users\andude3\Documents\bat>set c=0 C:\Users\andude3\Documents\bat>set /a c+=1 C:\Users\andude3\Documents\bat>set /p y= 0<net1.1 C:\Users\andude3\Documents\bat>ping LEMONILLA -n 1 \\LEMONILLA \\NATHANSCHOOL \\ No idea why it's showing the network, or why it is waiting for a prompt. Usually pause gives a written prompt, but this only response to enter. when you press enter you get : Code: [Select]FIND: Parameter format not correct ad FIND: Parameter format not correct aasdfasdf FIND: Parameter format not correct This HAPPENED even when I deleted the pipe (not just REMed it out). I guess this is a start, but I still have no idea what it is talking about. Thank you for your help.Have you got a find.bat and/or ping.bat (or .cmd) in the same folder? Quote from: Salmon Trout on July 11, 2012, 07:53:37 PM Have you got a find.bat and/or ping.bat (or .cmd) in the same folder? Or anywhere on the path. Is this batch file you are using called ping?Quote from: foxidrive on July 11, 2012, 11:08:24 PM Or anywhere on the path. Is this batch file you are using called ping?Quote from: Salmon Trout on July 11, 2012, 07:53:37 PM Have you got a find.bat and/or ping.bat (or .cmd) in the same folder? That's not the first time someone has made that mistake on this forum.Quote from: Squashman on July 12, 2012, 05:46:38 AM That's not the first time someone has made that mistake on this forum. It's the first thing I think of in a situation like this, along with a new variable called PATH . Quote from: foxidrive on July 11, 2012, 11:08:24 PM Or anywhere on the path. Is this batch file you are using called ping?LOL yup. Changed it'd name and that part works now. Thank a bunch. |
|
| 6632. |
Solve : command for looping and stop? |
|
Answer» what command to add to make my test PROGRAM run for 100 cycles, then Stop. |
|
| 6633. |
Solve : how to retrieve file creation date and how to compare tat date with the s/m dat? |
|
Answer» hi, ("Scripting.FileSystemObject") Scripting.FileSystemObject-?? A little more about this how it used and properties. File System Object Quote Contains methods and properties that allow you to create, DELETE, gain information about, and GENERALLY manipulate drive, folders, and FILES.Source: Windows Scripting Technologies (compiled Help file) For a technical discussion, check out Files and Folders Note: The FileSystemObject does not handle databases which have their own set of objects. Good luck. |
|
| 6634. |
Solve : Eject/Load CD-ROM? |
|
Answer» what command in mdos to eject/load cd-romyou can use WSH, if you have |
|
| 6635. |
Solve : Hidden Messages? |
|
Answer» I found SOMETHING out which is kind of useless but still kind of cool. |
|
| 6636. |
Solve : change in copy command of dos? |
|
Answer» I want to rename or delete the copy command of dos or windows98. Is this possible if yes PLS help meIt is built into the command processor; it is not possible to remove ITI seem to remember this topic not so LONG ago. I seem to remember this topic not so long ago. What part of that do you not understand? |
|
| 6637. |
Solve : Path of batch file? |
|
Answer» I am going to make a batch file and I want to show where the file is located. For EXAMPLE: |
|
| 6638. |
Solve : Kill !?? |
|
Answer» I was wondering if it would be POSSIBLE to make something for killing a running process, if so, what ?Are you TRYING to find out how to kill a running process? You do that by going into task manager by right clicking your taskbar then clicking task manager then to processes or applications then hit end task or process.Which operating system? so try something like this then: Thanks Pr0FiT, yea i did that on taskkill, it didnt feel like working, i'll try this 1 outAdd /f to the end to force it to close. So: Code: [Select]@echo off taskkill /im xxx.exe /f |
|
| 6639. |
Solve : Help with script (please!)? |
|
Answer» Okay so my goal here is to have a script search a users' homedrive for any and all pst files. It will then edit a text file and update certain LINES of the text file with the path to the pst, the END goal being for the script (or a series of scripts) to compile a .prf file used to import config info into Outlook. Here's the code I'm using right now: |
|
| 6640. |
Solve : Need a Batch file to append txt in all files first line? |
|
Answer» I need a batch FILE that, when given a list of files in a folder will insert the filename itself in the first LINE for all the files. |
|
| 6641. |
Solve : Problems with integrating my SCSI CD ROM drive into MS-DOS? |
|
Answer» Hello! Autoexec.bat This is the failure message appearing at the very end: Device driver not found: "AspiCD0". No valid CD Rom device drivers selected What's wrong? Thank you so much in advance!Try adding the directory that contains the SCSI drivers in the path statement in the autoexec.bat file... Example: PATH C:\DOS;C:\TREIBER\ASPI8DOS.SYSThanks, but unfortunalety it didn't help. There's STILL the same error message. I have made a photo from this screen - please have a look: http://www.bilder-hochladen.net/files/2gjg-3-jpg.htmlYou will have to go to the manuf. site and see if they have native DOS drivers for that unit.... If not i'm afraid you might be out of luck.Quote from: patio on April 10, 2007, 09:30:39 AM You will have to go to the manuf. site and see if they have native DOS drivers for that unit.... Thanks for this little hint!!! I have worked it out now and I'm very very happy!!!!!! It was a long way to solve it. With your hint I got to the manuf. site of the SCSI Controller...Adaptec. In a driver package I found a readme.txt with a list of all drivers and the models associated. I have a special model which needs another driver as the standard controllers (<- ASPI8DOS.SYS ...) named MCAM18XX.SYS. With this driver it works perfectly. Thanks for your help and the IMPORTANT little hint which LED me to the manuf. page from the scsi controller.Excellent ! And WELCOME Aboard ! ! |
|
| 6642. |
Solve : Identifying source drive in XCOPY? |
|
Answer» Can you help with using XCOPY from within a BAT file that I put on a CD? I have been using the following: |
|
| 6643. |
Solve : bat file - how to ignore window errors? |
|
Answer» I'm LAUNCHING pdf files within a bat file. I pass the instruction into bat file as a parm. It works great except for when the pdf doesn't EXIST and displays error window. Is there any way to ignore the error and don't display the error window? Is there a way to check if the pdf exist first before launching the pdf? |
|
| 6644. |
Solve : changing the desktop bg? |
|
Answer» does ANY1 know how to change the desktop bg using command promptif you got xp this works does any1 know how to change the desktop bg using command prompt how should I learn dos from the very basicwww.google.com You'll first have to learn that DOS is not the command prompt on XP. if you typed it .. the second part i mean , it looks like the comma is beside the s , it isnt.. theirs a space in it , if you have xp it should work , even if it doesent the wallpaper changes if the first part works .. just restart |
|
| 6645. |
Solve : Color Result.txt? |
|
Answer» Hello, |
|
| 6646. |
Solve : block certain sites using batch file???? |
|
Answer» Quote from: Sidewinder on December 26, 2008, 04:54:31 AM An IP address is a quartet of binary numbers. A (traditional IPv4) IP Address is a 32-bit value. Because the different bytes have meanings, they are often seen represented as 8-bit quadruplets (or "dotted quads") of decimal numbers. These are more convenient for humans to get their heads around. You can use the 32-bit value in most internet clients (i.e., web browser, FTP client) instead of the dotted quads or the domain name. Converter here http://www.geektools.com/cgi-bin/ipconv.cgi Or use ping to convert from long to quad For example, the 32 bit IP address 1249725795 translates to the dotted quad form 74.125.77.99 Code: [Select]C:\>ping 1249725795 Pinging 74.125.77.99 with 32 bytes of data: REPLY from 74.125.77.99: bytes=32 time=398ms TTL=244 Reply from 74.125.77.99: bytes=32 time=442ms TTL=244 Reply from 74.125.77.99: bytes=32 time=323ms TTL=244 Reply from 74.125.77.99: bytes=32 time=427ms TTL=244 Ping statistics for 74.125.77.99: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: MINIMUM = 323ms, Maximum = 442ms, Average = 397ms varunjose, make sure you have the dotted IP address 127.0.0.1 correctly shown in your hosts file! You could use 2130706433 but let's not complicate matters! Why have you not posted your hosts file? Do so or risk termination of help. |
|
| 6647. |
Solve : Creating a shortcut for user after extracting a setup file? |
|
Answer» I've been on this for more than a day already, cracking my brains out. |
|
| 6648. |
Solve : How to exlude parts of a filename? |
|
Answer» I have files in my FOLDER: |
|
| 6649. |
Solve : A batch file I made? |
|
Answer» Hey everyone, I just want to share a batch file I made because i was bored. |
|
| 6650. |
Solve : Entering 'spacebar' in script? |
|
Answer» Hey all, |
|