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.
| 4551. |
Solve : Batch file for network login and file transfer? |
|
Answer» Hello everyone. |
|
| 4552. |
Solve : Please let me know? |
|
Answer» I dont know when the song will be stopped. I dont know the PID. |
|
| 4553. |
Solve : Please I need the solution? |
|
Answer» PLEASE dont take it badly that the same topic I am ASKING once again I am a beginer and WANT to learn this field. Please let me know the batch file code to close media player window. Excuse me. THANKS debduttaaCode: [Select]taskkill /IM wmplayer.exeplease STOP asking this question |
|
| 4554. |
Solve : Not working? |
|
Answer» @echo on |
|
| 4555. |
Solve : Kill a process? |
|
Answer» I cant kill a process. Please HELP me,OTHERWISE I cant PROCEED further. THANKS devduttaaGoogle for Taskkill.Here ya go: Use REVO Uninstaller to Terminate UNRESPONSIVE Processes |
|
| 4556. |
Solve : Replace str in variable with parameters passed to batch? |
|
Answer» Hi |
|
| 4557. |
Solve : How do I capture the timestamp? |
|
Answer» Dear all, |
|
| 4558. |
Solve : Delete File in specific time? |
|
Answer» How can I DELETE a .txt file created in a BATCH file after 3 seconds or so? Is it possible?Quote from: joedavis on March 30, 2009, 08:21:42 PM C:\>TYPE del3sec.bat i didn't know there is sleep command/exe in nt dos. C:\>sleep 'sleep' is not recognized as an internal or external command, operable program or batch file. to delay in nt dos, something that come close to it C:\>ping -n 3 localhost>nul for more accurate delay, use vbscript: wsh.sleep 3000"sleep" is in the windows RESOURCE kit. http://www.activexperts.com/activmonitor/windowsmanagement/reskit2000/0035/ |
|
| 4559. |
Solve : Opening IE tabs with date in url? |
|
Answer» As implied from a previous conversation, I should start a NEW thread about this topic. Here is an edited copy-paste of the original question: |
|
| 4560. |
Solve : Date in created file.? |
|
Answer» Hi There, IMHO the date used to name a file should be in the format YYYYMMDD so that files listed by the Dir command will be in date sequence. But they will anyway if you type dir /od, won't they?Hi Guys, Perfect. Thanks for all your help. Got it working just how I wanted. Your input was most appreciated. Best Regards, Steve.Glad it worked out for you. Same Hello guys, I have a very similar question so I thought it won't be necessary to open a new thread, just a follow-up would be enough. Basically, what I want to do is to open five tabs in Internet Explorer. I have to work with data PAGES on our company's intranet. I won't get into details about what they are because that would be very long, tedious and boring. The format of the url is: http://XXXX/XXXX/XXXX/cms[date].html For example, today would be: http://XXXX/XXXX/XXXX/cms30032009.html (so it is DDMMYYYY) and I need to have the last five days opened in tabs. - cms[today -4 days].html - cms[today -3 days].html - cms[today -2 days].html - cms[today -1 day].html - cms[today].html I got my answer for today, but how should I write it for the first four tabs? Thank you Martydont hijack some one elses thread.It is not a hijack. I admit I don't know the habits of this forum but I know that usually, mods frown on starting a new thread about something that already exists (or is very similar to). You don't know the mods here so you can't assume something with out knowing it.No, I don't know the mods here. I was referring to the mods I know on other forums. Geez, I CERTAINLY did not expect that my first post would fire such reactions. Did I touch a sensible issue? If yes, then I APOLOGIZE. Rest assured though, I am not a troll or anything like that. I just asked a simple question.. Edit: no it just keeps thing simple this way. |
|
| 4561. |
Solve : Cmd or Program to do ls -lrt | tail -1 as done in Unix? |
|
Answer» Quote from: smartjosh on March 27, 2009, 04:45:04 AM 2. You want to subtract 1 from e.g. 26 to GET 25? Or get the previous day's date? smartjosh, here is the bat way to calculate date difference, source is from wiki, and i haven't tested it throughly, so may STILL contain bugs. if you did have access to vbscript, it's easier to do it with vbscript. Code: [Select]::source: http://en.wikipedia.org/wiki/Julian_day @echo off & setlocal if "%~1"=="" echo USAGE: %0 [interval] & goto:eof for /f "skip=1 tokens=2-4 delims=(./-)" %%a in ('echo.^|date') do ( for /f "tokens=1-3 delims=./- " %%A in ('echo %date:~-10%') do ( set %%a=%%A& set %%b=%%B& set %%c=%%C )) echo TODAY :%yy%%mm%%dd% set/a mm=1%mm%-100,dd=1%dd%-100 ::JD set/a a=(14-mm)/12, y=yy+4800-a, m=mm+12*a-3 set/a jd=dd+ (153*m+2)/5 + 365*y + y/4 - y/100 + y/400 - 32045 ::date interval set/a jd+=%~1 ::gd set/a s1=jd+68569, n=4*s1/146097, s2=s1-(146097*n+3)/4, i=4000*(s2+1)/1461001 set/a s3=s2-1461*i/4+31, q=80*s3/2447, s4=q/11, e=s3-2447*q/80 set/a yy=100*(n-49)+i+s4, mm=q+2-12*s4, dd=e, gd=yy*10000+mm*100+dd echo %1 :%gd% test output Code: [Select]C:\>jd 10 Today :20090330 10 :20090409 C:\>jd -1 Today :20090330 -1 :20090329 C:\>jd -1000 Today :20090330 -1000 :20060704 |
|
| 4562. |
Solve : SCREEN CAPTURE? |
|
Answer» Is there any way with Batch Script or VBS to make a lil app that captures the desktops screen in a predefined time interval like every 3 seconds and then it saves each screen-shot somewhere in a timestamped .jpg file with the users name in the file name like: helpmeh, do you have the source code for that? I don't have the source...I saw it a while ago on youtube...but it automatically saves the captured image.yesterday i play around vbs, and finally have working code to capture screen. if anyone still interested on how to do it, let me know, and i will share the code here. I could really use that.Quote from: Helpmeh on March 29, 2009, 05:13:43 PM I could really use that. here you go, helpmeh. the solution is not pure vbs. Code: [Select]'captureie.vbs d=year(date)*10000+month(date)*100+day(date) with createobject("wscript.shell") if not .appactivate("Internet Explorer") then wsh.echo "Internet Explorer is in tray state or could not be found" wsh.quit 1 end if ' .sendkeys "%{prtsc}":wsh.sleep 200 'not working ' .run ".\printscreen.exe screen",1,false .run ".\printscreen.exe",1,false .run "c:\windows\system32\mspaint.exe",1,false:wsh.sleep 1000 if .appactivate("untitled - Paint") then 'resize to 1x1 pixel & paste from clipboard .sendkeys "^e1{TAB}1~^v" 'save as ".\ie yymmdd.jpg" .sendkeys "^sie " & d & "{TAB}{DOWN 2}~~%yy" else wsh.echo "Failed to activate Ms Paint" end if end with because there is something wrong with sending printscreen keystroke from vbs, i am using temporary solution by calling win32 api, "keybd_event". so create printscreen.exe with your favourite IDE. here is a sample with VB6. Code: [Select]Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Const VK_SNAPSHOT As Long = &H2C Sub Main() If INSTR(VBA.Command$, "?") <> 0 Then MsgBox "USAGE: " & App.EXEName & " [SCREEN]" & vbNewLine & vbNewLine & _ "Argument:" & vbNewLine & _ "Screen - capture entire screen " & vbNewLine & _ "If omitted - capture active window" ElseIf UCase(VBA.Command$) = "SCREEN" Then 'entire screen keybd_event VK_SNAPSHOT, 0, 0, 0 Else 'active window keybd_event VK_SNAPSHOT, 1, 0, 0 End If End Sub i am still looking for a way to call win32 api EASILY from vbs. |
|
| 4563. |
Solve : can someone edit my autoexec.bat and config.sys please? |
|
Answer» Ok, so I think I have most of this figured out here all but one line I think? I've loaded the driver for the ethernet card but when I get past the startnet.bat - (I think) and I receive an error that: "Lantastic Redirector (REDIR) must be installed". If I place the redir.exe somewhere in the autoexec.bat I get the error: "Netbios is not present". What should I do with the redirector? Here's the config.sys, autoexec.bat, startnet.bat, |
|
| 4564. |
Solve : Batch File Help Needed Please!? |
|
Answer» Hi, |
|
| 4565. |
Solve : Really I feel helpless? |
|
Answer» @echo on |
|
| 4566. |
Solve : Help with a boot-discs image? |
|
Answer» Hi folks, im new here could be wrong, but i doubt msdos 6.22 would fit on a a:\drive diskette MSDOS 6.22 came on a set of install FLOPPIES but (of course!) it is also possible to MAKE an MS-DOS boot floppy, usually containing config.sys, autoexec.bat, command.com, io.sys, msdos.sys, POSSIBLY mscdex.exe as well. On40, if you mean, how do I transform a floppy image into a real floppy disk. the answer is with software. The same software that will make img files from your (extracted) zips. http://www.google.co.uk/search?num=100&hl=en&safe=off&q=floppy+image+writer&btnG=Search&meta=&aq=5&oq=floppy+imageOh sorry guys. I have been away from a looooonnnggg time. Actually i forgot everything about you. What i means is: How do you properly install Dos? I really want the whole DOS over on the root drive and away from the floppy.You create a virtual disk and then you create a partition with fdisk, format it and transfer the system files on to it. |
|
| 4567. |
Solve : Ghost Bootable Floppy, need help..? |
|
Answer» HI, I am having trouble on creating a bootable Floppy disk with over 3mb source files. Does anyone knows how to do it? The TECHNICAL Support engineer left earlier this month and he did it SOMEHOW..... Please help..Floppy maximum size 1.44 MB. Please state what you want to place on floppy. I remember DMF but, it still will not go to 3 MB. http://www.alkonost.com/maxformat/You can have 2.88 MB floppies, but you need a special drive. Multiple disks may be the way to go. Or spanned zip files. To the OP: Why didn't you get a new technical support engineer? Ghost comes with a program to create bootable floppies called "Ghost Boot Wizard.exe". It makes a 2 floppy set with either PC-DOS or MS-DOS. If you have any CD/DVD's that were used by Ghost to backup, the first one will be bootable and run Ghost (assuming that the make disk bootable option was selected at time of creation which everyone I talk to does). |
|
| 4568. |
Solve : I am frustated with batch file? |
|
Answer» PLEASE help me to WRITE a batch file to OPEN a file or FOLDER. I am frustated. Thanks devdutta |
|
| 4569. |
Solve : Unable to booy my lapptop? |
|
Answer» My computer won't start up the power is on and the CURSOR blinks but that's about all it does. How do I BOOT my laptop without a bootdisk I am on win XP CHEERS You can install Image Burn and write a CD from the windows 98 SE boot disk ISO. |
|
| 4570. |
Solve : Operating System Query? |
|
Answer» HELLO, I want to install sql server as a database server and Oracle 10 I as a PROGRAMMING language for this i choose windows 2003 server as a operating system..OK.and come to hardware part i have 8 SATA hdd's each one has 300 gb of capacity. my requirement is i want to insert these 8 HDDS into a system by using RAID LEVELS(Leave about configuration). in Raid Levels which level will give 100% data backup(safe).if u give preference for one particular raid level please let me know what are the benefits with that Please suggest me with best answers. ThanksThis is either your homework or else your employer is the biggest cheapskate I have ever heard of. I suspect the former. Quote from: Gracey on March 06, 2009, 05:34:39 AM Hello, Gracey, when we use raid facility ,we can connect only 4 hard disk,because no any option r available in our motherboard thats why we connect more then 4 HDD. i think like this if any other answer u may get p, please inform me. The most conservative RAID is where two disk are using together as a PAIR, both have the same data. But you would read this: http://techrepublic.com.com/5208-11184-0.html?forumID=56&threadID=187097 Somebody there asked a similar question and got LOTS of answers. |
|
| 4571. |
Solve : How to tag a video clip with a desktop icon with the help of a batch file? |
|
Answer» Suppose I have a VIDEO CLIP. I like that when I click an desktop icon,the video clip will PLAY first and then the window corresponding to the icon |
|
| 4572. |
Solve : Division in batch files?? |
|
Answer» Hello everyone. That should be correct. Thanks for the suggestion, removing the SPACES didn't change anything though. I don't get an error message but it doesn't seem to do anything either. I just get whatever is already in the variable and the division line doesn't seem to AFFECT it.What are %num1% and %num2% They should be something along the lines of: set num1=10 set num2=2You can have as many spaces as you like. Code: [Select]@echo off set num1=15 set num2=3 set /a sum1=%num1% / %num2% echo num1=%num1% echo num2=%num2% echo sum1=%sum1% echo %num1%/%num2%=%sum1% Output: Code: [Select]num1=15 num2=3 sum1=5 15/3=5I tried your example and it worked perfectly. I played with mine and the results seem inconsistent, I'll get one answer the first time and the correct answer the second time. It seems to have something to do with being in an IF statement, if that makes any sense. This is my file, with a couple extra lines for testing purposes: Code: [Select]@Echo off rem ==== Accept user input ======= Set /p num1=Enter num1: Set /P num2=Enter num2: rem ===== Calculate and display ===== set /a sum1=%num1%+%num2% Echo %num1% + %num2% is: %sum1% set /a sum2=%num1% - %num2% Echo %num1% - %num2% is: %sum2% set /a sum3=%num1% * %num2% Echo %num1% * %num2% is: %sum3% set /a sum4=%num1% / %num2% echo %Num1% / %num2% is: %sum4% rem ==== Check for division by zero ===== if %num2% == 0 ( echo Number not valid, 0 entered ) else ( set /a sum5=%num1% / %num2% echo %Num1% / %num2% is: %sum5% ) The last line is the goofy one. The first time I run it, it looks like this: Code: [Select]Enter num1: 8 Enter num2:2 8 + 2 is: 10 8 - 2 is: 6 8 * 2 is: 16 8 / 2 is: 4 8 / 2 is: 3 The second time I run the same thing and it looks like this: Code: [Select]Enter num1: 8 Enter num2:2 8 + 2 is: 10 8 - 2 is: 6 8 * 2 is: 16 8 / 2 is: 4 8 / 2 is: 4In a parenthetical statement, such as a FOR loop or an if statement like this, any variables that are set inside the parentheses, in this case, sum5, will expand to a blank or a previous value if there is one. Code: [Select]if %num2% == 0 ( echo Number not valid, 0 entered ) else ( set /a sum5=%num1% / %num2% echo %Num1% / %num2% is: %sum5% ) you have to use delayed expansion. This is because of the way cmd.exe expands the variables at run time. You have to use this statement (put it at the START just after the @echo off line) Code: [Select]setlocal enabledelayedexpansion and in the parentheses use exclamation marks (exclamation points if you are American) like this num1 and num2 are OK because they were set before the parentheses but sum5 needs delayed expansion. Code: [Select]if %num2% == 0 ( echo Number not valid, 0 entered ) else ( set /a sum5=%num1% / %num2% echo %Num1% / %num2% is: !sum5! ) Once you are out of the parentheses you can use % signs again for sum5. Watch out for spaces in IF COMPARISONS. They can catch you out. This is better Code: [Select]if %num2%==0 This is better still Code: [Select]if "%num2%"=="0"It works, thank you so much! I added Code: [Select]setlocal enabledelayedexpansionat the top and used exclamation marks and it works! |
|
| 4573. |
Solve : Simple batch menu question? |
|
Answer» I'm trying to make a batch menu with option from 1 to 3 but if I was to click say option 7 which is not register, it would automatically take me to option 1. Is there a way that it will only force my batch to accept option from 1 to 3 only. If the user enters say option 7 it would display Main_Menu again. :: --------------------------------------------------------------- I strongly suggest you do NOT use labels to start comment LINES. This is not supported. They can CAUSE problems for example such a line in a loop will break it. Use REM instead. Code: [Select] :start CLS TITLE MAIN MENU ECHO 1) Sub_MenuA ECHO 2) Sub_MenuB ECHO 3) Internet ECHO. ECHO. SET /p Option=Choice: if "%Option%"=="1" GOTO Sub_MenuA if "%Option%"=="2" GOTO Sub_MenuB if "%Option%"=="3" GOTO Internet echo. echo Please CHOOSE 1 to 3 only! echo. pause goto start Loc B Tran, Code: [Select] C:\>type menu.bat @Echo off :Start cls echo TITLE MAIN MENU ECHO 1) Sub_MenuA ECHO 2) Sub_MenuB ECHO 3) Internet ECHO 4) Quit ECHO. ECHO. SET /p Option=Choice: if "%Option%"=="1" GOTO Sub_MenuA if "%Option%"=="2" GOTO Sub_MenuB if "%Option%"=="3" GOTO Internet if "%Option%"=="4" GOTO EOF Goto Start :Sub_MenuA echo Sub_MenuA pause Goto Start :Sub_MenuB echo Sub_MenuB pause Goto Start :Internet echo Internet "c:\program files\internet explorer\iexplore.exe" http://www.google.com/ Pause Goto Start :EOF C:\> Output of menu.bat Quote C:\>type outmenu.txtthank you the code works perfectly. |
|
| 4574. |
Solve : Compare file date to system date and copy to archive? |
|
Answer» Hi team, How is the file named? like: 03-26-2009.txt I believe it's a file creation date that he wants to check, not a file name, but of which file it isn't clear.for today date, there is no need to ask for user system date format, check the FOLLOWING and you will understand. Code: [Select]+C:\>echo %date% Thu 03/26/2009 +C:\>echo %date:~-10% 03/26/2009 +C:\>set d=>file.txt & for %a in (file.txt) do @set d=%~ta & echo %~ta & call echo %d:~0,10% 03/26/2009 08:50 PM 03/26/2009 the %~ta in for loop output MODIFIED date i believe. so for creation date, using dir command is one of the method.Quote from: Reno on March 26, 2009, 07:53:40 AM the %~ta in for loop output modified date i believe. so for creation date, using dir command is one of the method. It returns file creation date on my system Also, date string will be different in non-US locales. now i set my regional setting to albanian: Code: [Select]+C:\>echo %date% 2009-03-26 +C:\>echo %date:~-10% 2009-03-26 +C:\>set d=>file.txt & for %a in (file.txt) do @set d=%~ta & echo %~ta & call echo %d:~0,10% 2009-03-26 09:08MD 2009-03-26 we only need to check for equality of 10char string here. no math involved, and no yy mm dd parsing. only works for today date though, except bulgarian.Quote from: Reno on March 26, 2009, 08:14:42 AM we only need to check for equality of 10char string here You're right. Quote from: Dias de verano on March 26, 2009, 07:35:33 AM I believe it's a file creation date that he wants to check, not a file name, but of which file it isn't clear. FINFO >I want to add a line into the batch file to test if the date of the file is today. If not then stop processing. I can see the confusion I've created here. Sorry about that. I want to test to see the file creation date for NEWBLUES.dbf is the same as the system date; if it is then continue processing. If it is not then the NEWBLUES.DBF is from an earlier date and we don't want to process this. Does this make more sense? >At the end of the batch, I want to copy specified files to archive. I meant here, to copy the files into a compressed file. Cheers Bernard |
|
| 4575. |
Solve : Drag and drop directory on batch file to process files and in subdirectorys? |
|
Answer» I am trying to write a batch FILE to change ID3 info in MP3 files. I would like to DRAG and drop directory on batch file to process files and in sub-directorys. How would I code the drag and drop part?Code: [Select]@echo off |
|
| 4576. |
Solve : Called batch file hangs - no return value? |
|
Answer» Hello Wait some time quick question- what are you waiting for? The line after the CALL command will only be executed after everything in the CALL'd batch is finished executing.if b.bat never return/hang, how would you ever get an %errorlevel% on a.bat??? even the next line after call b.bat is not going to be processed. my temporary suggestion is: (if i interprete your problem correctly) 1. create a timer.bat to check if devcon is still running. (run timer.bat as another process/thread) as your description is pretty vague, not to mention my english and interpretion skill is very bad as well, and i don't do mind-reading either. why not you post your code so we can help you better.Thanks for the responses. I've attached my code below. Hope it makes some sense. ************ Below is the calling batch file. Fairly simple and PIPES the output to a log file. It is in this batch file that I would like to TRAP the response code from the called batch file. The parameter is assigned by Windows' Task Scheduler which triggers this process in the first place - typically it is a simple text statement such as 'ScheduledTask' helpful as an audit trail. Primary: MyStart.bat call c:\MyFiles\mystartexec.bat %1 >> c:\MyFiles\mystartlog.txt exit *********************************************** Below is the called batch file. The issue I have is that from time to time the devcon statement (and once or twice the net start statement) fails to execute and the process essentially hangs. Why devcon hangs is a question I have been unable to answer but will continue to investigate (the device itself is a Hauppauge TV tuner card). In the short term though I'd like to identify that the problem has occurred and handle it externally and the only reliable way given the situation is to reboot. The internal logic (in mystartexec.bat) of trapping the devcon return code is not working (presumably because it has hung) so my thougth was to identify the problem in mystart.bat by allowing some reasonable period of time for a response from mystartexec.bat and then if nothing had been received assume a problem and reboot. The various echo statements are there simply to log progess so that I can debug. Called: MyStartExec.bat @echo off echo ***************************************** time /t date /t Echo Resuming Echo Source - %1 NET START | FIND "Windows Media Center Receiver Service" > nul echo Net find error level is %ERRORLEVEL% if %ERRORLEVEL% == 2 goto Trouble if %ERRORLEVEL% == 1 goto Stopped if %ERRORLEVEL% == 0 goto Going :Trouble Echo Other error so best to restart echo Trouble error level is %ERRORLEVEL% shutdown -r -t 01 goto end :Stopped Echo Media Centre was already stopped or maybe not exist but try devcon goto Devcon :Going Echo Media Centre can now be stopped net stop "Windows Media Center Receiver Service" /y echo Stop media service error level is %ERRORLEVEL% if %ERRORLEVEL% == 1 goto Trouble if %ERRORLEVEL% == 0 goto Devcon :Devcon echo At Devcon devcon restart usb\vid_2040* echo devcon error level is %ERRORLEVEL% if %ERRORLEVEL% == 1 goto Trouble if %ERRORLEVEL% == 0 goto Continue :Continue rem ping 1.1.1.1 -n 3 -w 1000 >NUL echo At Continue net start "Windows Media Center Receiver Service" echo net start error level is %ERRORLEVEL% if %ERRORLEVEL% == 1 goto Trouble %systemroot%\ehome\ehshell.exe /homepage: RecordedTV.BrowsePage.xml /PushStartPage: True - Recorded TV echo WMC error level is %ERRORLEVEL% goto end :end time /t echo end echo **************************************** exitadd the following batch file: Code: [Select]::ProcessTimer.bat @echo off if "%~1"=="" echo Usage: %0 ProcessName & goto:eof %2start %comspec% /c %0 %1 :: & goto:eof >nul ping -n 60 localhost tasklist|find "%~1" && (taskkill/f /im "%~1" || %0 %1) ::pause then change this line: devcon restart usb\vid_2040* to call processtimer "devcon.exe" devcon restart usb\vid_2040* the same goes for net start: call processtimer "net.exe" net start "Windows Media Center Receiver Service" what the ProcessTimer doing is wait 60seconds, then check if the process still running, if yes, force kill it, if it's still running, try again. Warning: Killing a running process might produce unexpected result. this is from the helpfile tasklist/? and might be interest for you: Filters: Filter Name Valid Operators Valid Value(s) ----------- --------------- -------------- STATUS eq, ne RUNNING | NOT RESPONDINGThanks for the suggestion. Have been unavailable a few days will try tonight and advise. Cheers |
|
| 4577. |
Solve : Related to internal speakers (please do read..!!)? |
|
Answer» I have a software that results in a series of beeps from the internal speakers of my CPU. |
|
| 4578. |
Solve : General format of a to run a program in window mode.? |
|
Answer» I was trying to run a video file with PLAYER. But I don't find the to run a program (specialy .EXE file). Why do people think Command Prompt can do all these magical things? It must seem very advanced to them. Like what uber-geeks do with their Unix boxes. As Arthur C. Clarke said, "Any sufficiently advanced technology is indistinguishable from magic". (His "third law of prediction".) Disregarding the "not in command prompt but windows mode" 1. If you want to play a vide with VLC player or something you would set VLC as the default program to start that kind of video file. With that being said, to start the video you would do: Code: [Select]start (path to video file) 2. Then if you want to play it for a certain amount of time you would do and start another program you would do: Code: [Select]start (path to file) ping 127.0.0.1 -n (amount of time to wait) taskkill (video).* start (path to microsoft word) This is all disregarding the windows mode THING. But you could put this in a batch file (a text file with a .bat extension) In response to Joedavis' post, you can just put the following: Code: [Select]start wmplayer start winword It is not what he wanted though. |
|
| 4579. |
Solve : Menu Batch not working? |
|
Answer» I am trying to get this menu batch to work but every time I run it it just scrolls threw start to command prompt. I don't have choice on my comp where can i get it if not is there a other way to get the menu to work. You can use SET /P with IF and that will work just as well. Code: [Select]:loop set /p choice= if %choice% == 1 goto 1 if %choice% == 2 goto 2 if %choice% == 3 goto 3 if %choice% == 4 goto 4 Echo You must enter EITHER 1, 2, 3 or 4! goto loop Modify that to your uses, but it should fit fine.Code: [Select]@Echo off :start cls echo echo Main Menu echo echo 1.Clear Backup disk echo 2.Backup Files echo 3.Restore Data echo 4. Quit echo echo echo echo. echo. echo =============================== choice /c [:]1.2.3.4. Enter option echo =============================== Echo. If %Errorlevel%==4 Goto Exit If %Errorlevel%==3 goto 3.bat If %Errorlevel%==2 goto 2.bat If %Errorlevel%==1 goto 1.bat Batch can't use letters / symbols not on your keyboard.Could you please clarify? |
|
| 4580. |
Solve : Batch - UPS Load Test Logger? |
|
Answer» I have a stack of UPSS that the company wants to test the health of and instead of having to baby SIT them and pay attention to when they drop out to calculate amp hour draw to figure out the battery health under a 100 watt light bulb draw, I came up with this batch file to record the pings to a low draw network device that is also powered through the UPS. |
|
| 4581. |
Solve : Could someone make it for me...? |
|
Answer» Hello, I started an intenship in a company in which I can't install new softwares. Beware - your internship may be brought to a sudden halt if what you are doing is not permitted by company rules. Quote However, I'd like to log automatically my arrival and departure times every days. This may already be being MONITORED without your knowledge. Quote "A required privilege is not held by the client" Your unauthorized ATTEMPTS to extend your existing privileges may ALSO be monitored. Don't be so paranoid... nobody will fire an employee because... he wanted to log automatically his working hours!! Quote This may already be being monitored without your knowledge.Yeah actually it is done for all the employees via smart cards except for interns who are monitored "visually" by the supervisors. So I wanted to know precisely my working time... as I always do extra time. Quote Your unauthorized attempts to extend your existing privileges may also be monitored.Definitely... and maybe EVEN this message I'm writting to you may be moniited... so what... it's not like I had something to hide. About the failling "shutdown" command... does somebody know a solution to automatically launch this script when I'm shutting down the computer manually (via start->shutdown button)?1. rundll32 shell32,#60 this popup the standyby/shutdown/restart dialog in my xp 2. copy c:\windows\system32\shutdown.exe and rename it as a new name. eg. sd.exe then at bat file: sd -s 3. type the following on command prompt, and see which one is accessible (in case the above two option doesn't work: gpedit.msc regedit wmic cscript Quote from: Derdonn on March 27, 2009, 06:29:15 AM About the failling "shutdown" command... does somebody know a solution to automatically launch this script when I'm shutting down the computer manually (via start->shutdown button)?if your windows is xp pro, do you have access to gpedit.msc?Just fyi, Shutdown -s -f will force shutdown. |
|
| 4582. |
Solve : batch file to open a word file and goto a special bookmark? |
|
Answer» How can I write a batch file to open a word file and goto a special bookmark? no you can't , not in batch. but, you could do the whole thing with a single VBS script, couldn't you, using Word.Application and directly accessing the bookmarks collection?Quote from: shelam on March 22, 2009, 10:17:01 PM How can I write a batch file to open a word file and goto a special bookmark? hmmm, because he is looking for a batch solution?? batch+macro <-- and this one has the batch part Quote from: Reno on March 23, 2009, 08:34:36 AM hmmm, because he is looking for a batch solution??depends write a vbscript, execute from the cmd.exe as Code: [Select]cscript <my_vbscript.vbs> and save it as a .bat file. would you call that batch? Quote from: ghostdog74 on March 23, 2009, 08:37:34 AM depends write a vbscript, execute from the cmd.exe as wsh+batch??I don't see any reason to even involve batch here except as a stub to execute the script. Now if I wrote the script in perl I could see it- since not EVERYBODY has a Perl interpreter; but VBScript is included in all versions of WINDOWS from W2k up (I believe it's in win98, but I'm not sure) we are exploring script because: Quote How can I write a batch file to open a word file and goto a special bookmark?is impossible without modifying the Document (which kind of limits the documents one can use it on to ones that contain this macro), thus my solution which works with almost any Doc file containing bookmarks. you took the "liberty" of using a macro within the document- I basically conglomerated all the logic from both the macro and the batch into a single abstract solution. Basically use the best tool for the job- it's kind of silly to go dancing around in a Word document to add macros for use with a batch when a script can perform the same thing in a FAR more abstracted manner to any word document that contains bookmarks. Anyway- does GetObject exist in VBScript? my original idea was to try to open the document specified in an existing word window- But GetObject doesn't Seem to work. I haven't used it in a while, and cannot remember if getobject err's out if the CLASSNAME isn't in the ROT or wether it will implicitly create the object and return it... Set wordapp = GetObject(,"Word.Application") adding getobject to BC_Programmer code: Code: [Select]if wsh.arguments.count < 2 then WScript.echo "Not enough arguments. Required syntax:" wscript.echo CHR(13) + CHR(10) wscript.echo "wordmark <filename> <bookmark>" Else on error resume next Set wordapp = GetObject(,"Word.Application") if err <> 0 then err.clear on error resume next set wordapp = createObject("Word.Application") end if if err <> 0 then wscript.echo "failed to acquire Word COM server object" Else on error resume next set newdoc = wordapp.Documents.Open(wsh.arguments(0)) if err <> 0 then wscript.echo "Failed to open word document, " + wsh.arguments(0) wordapp.quit else wordapp.Visible=true newdoc.Bookmarks.Item(wsh.arguments(1)).select end if end if 'wordapp.quit set wordapp=nothing end if with proper indention fix Quote from: Reno on March 23, 2009, 09:03:56 AM Set wordapp = GetObject(,"Word.Application") thanks reno, I suspected it was some convoluted parameter list. and with that the line: Code: [Select]set wordapp = createObject("Word.Application") can become Code: [Select]Set wordapp = GetObject(,"Word.Application") Quote from: BC_Programmer on March 23, 2009, 09:09:10 AM thanks reno, I suspected it was some convoluted parameter list. THANK you too for the vbs code. i dont think createobject line should be replaced by getobject.Quote from: Reno on March 23, 2009, 10:00:15 AM thank you too for the vbs code. well... not the way it is now. Code: [Select]GetObject("",classname) will do the implicit creation if the program isn't running, whereas not supplying the first argument will cause it to err if the program isn't running. Also if CreateObject succeeds but we fail to open the file, we should also call Quit(). But if Getobject succeeds and we can't open it we should leave it open since the user had word open. Right now I have it quit if it cannot open the file, regardless.Quote from: BC_Programmer on March 23, 2009, 10:05:43 AM well... not the way it is now.i don't see any difference between GetObject("",classname) and CreateObject(classname). i can't get a working code with just GetObject(), it still created 2 instance of WinWord.exe. i am curious if this can be done, whether getobject & createobject can be shortened to GetObject("",classname). if it works, this can save few lines of code. it might be specific to VB6, since that's how I tested it. Word wasn't running, and "GetObject(,"Word.Application") just errored with "ActiveX Component Cannot create Object" but using GetObject("","Word.Application").Visible=True started word- even though it wasn't running. Looked in the docs- this explains it: Quote If PathName is a zero-length string (""), GetObject returns a new object instance of the specified class type. If the PathName argument is omitted, GetObject returns a currently active object of the class type specified in Class. If no object of the specified type exists, an error occurs. I've always thought they had kind of silly semantics if you ask me. but it's better then trying to enumerate the ROT ourselves... |
|
| 4583. |
Solve : ...batch file to execute a command after a program closes? |
|
Answer» ...can SOMEONE help in the codes needed in order to EXECUTE this ...can someone help in the codes needed in order to execute this In the batch file Code: [Select]start /WAIT "" "Program.exe" nextbatch.bat |
|
| 4584. |
Solve : filter a text file using batch? |
|
Answer» Is it possible to use a DOS to EXTRACT FILE names from an text file and copy those files to another DIRECTORY? |
|
| 4585. |
Solve : RD batch file? |
|
Answer» I am using the following line in a batch FILE, but it always ask if its a file or a directory. How do I get around this? I need it to run unattended nightly. |
|
| 4586. |
Solve : sechduled bat file setup for scans? |
|
Answer» I want to make a bat that I just run from my desktop that does it at certain TIMES then after start one then the others follow like open and exit flow. But how do I really go about that? for like the time I want the clock to be the trigger. Thought that it be easier since i wouldnt have to set setting across multi machines, just MOVE the file and if its all there just run it like as is.Use WINDOWS Scheduled Task Manager |
|
| 4588. |
Solve : Extracting a string from logfile? |
|
Answer» Hi Folks, |
|
| 4589. |
Solve : Logon & Logoff info with %TIME% (Excel format issue)? |
|
Answer» I TRIED to read up on some of the more current threads before posting this, but didn't see anything similar enough. I'm new at a job and inherited this issue (so I'm not even sure it's the best method for achieving this goal). |
|
| 4590. |
Solve : how to check permissions?? |
|
Answer» Hi all, want to sit and wait untill the user enters the password You do, do you? I was going to ask why do you want to do this, Mister One Post, but on reflection whatever your reply MIGHT be I don't think we should provide a solution in view of the potential for abuse. woooo, ok i can SEE where you guys are coming from but this isnt for malicious purposes. I mean why would i of told you what i wanted to do if it was, i would of just made up some other crap. The scenario is basically the user (which are many using the same key fob) insert the key and run a batch file. the batch runs the keys log on program (kept on the key) and when the user enters the key fobs password the batch file copies the up to date VERSION of files from a server to the fob. Its just to simplify the copy process for the user and remove errors. Its one of my FIRST batch programs hence the 1 post, cheers.Well, how do you think a person might check if a medium was write enabled? Try writing to it and see if it is successful. but i don't know how you do this in a batch file. i have only really used .net so i don't know whats even possible using batch files, hence why i asked here. you can use the && and || operators. Hilarious!! what a friendly forum, think ill hang around..... Quote from: BatchHelp2009 on March 27, 2009, 08:43:00 AM Hilarious!! what a friendly forum, think ill hang around..... It's a responsible forum. You didn't get what I was DRIVING at, did you? You might or might not have honest intentions, but this is a forum on the world wide web. That means if I wrote your script for you any dumb script kiddie can surf by and pick up a ready made script to flood pen drives with whatever he wants as soon as they become unprotected. Anyway, with the transfer out of the user's control, how do you know they won't pull the pen drive out half way through and corrupt the filesystem? Quote I mean why would i of told you what i wanted to do if it was, i would of just made up some other crap. Oh right! "If I was a liar I wouldn't be telling you the truth, I'd have made up some lie, so you see you've got to believe me." "would of" Quote from: BatchHelp2009 on March 27, 2009, 08:27:11 AM i have only really used .net Explains it all. Well, not really. I just wanted to pick on this. |
|
| 4591. |
Solve : if exist? |
|
Answer» hello |
|
| 4592. |
Solve : Counter in for loop doesn't increment? |
|
Answer» To all, To all,basically, you just need a LINE count of the file correct? you can use one of these methods 1) use a unix tools like wc, gawk Code: [Select]# wc -l < file check out the link in my sig to download. (coreutils) 2) if you have constraints about "installing" tools, you can use vbscript Code: [Select]Dim o o=0 Set objFS = CreateObject("Scripting.FileSystemObject") strFile= "C:\test\file.txt" Set objFile = objFS.OpenTextFile(strFile,1) Do Until objFile.AtEndOfLine strLine = objFile.ReadLine o=o+1 Loop WScript.Echo "number of lines: ",o 3) or you can use find Code: [Select]find /c /v "" file Oh God! Another "how do I make this batch work?" question answered by "Get a port of a Unix util". Heaven forbid we should actually answer the *censored* question! April, due to the way that cmd.exe expands variables at runtime, an ordinary variable which is set inside brackets (parentheses) such as in a loop or an extended IF statement, will expand to a blank. You need to know about "delayed expansion". You enable it by putting this line before the loop Code: [Select]setlocal enabledelayedexpansion Then inside the loop you use exclamation marks instead of percent signs for those variables created or modified inside the loop. You can use percent signs for them after the loop has finished. So here is your code rewritten a bit Code: [Select]setlocal enabledelayedexpansion set x=0 for /f %%i in (f.txt) do ( echo A, !x! set /a x=!x!+1 echo %%i echo B, x=!x! ) echo C, x=%x% :ENDQuote from: DIAS DE verano on March 27, 2009, 08:09:08 AM Oh God! Another "how do I make this batch work?" question answered by "Get a port of a Unix util".as long as OP has no constraints, i don't think there's a problem with that. Quote from: ghostdog74 on March 27, 2009, 08:23:40 AM as long as OP has no constraints, i don't think there's a problem with that. I know you don't. |
|
| 4593. |
Solve : How to use TYPE command? |
|
Answer» I have a problem where php files have the wrong linefeed after uploading them via ftp. I'm looking for a way to do a batch convert on a nmber of files to fix this problem. I found this article http://en.wikipedia.org/wiki/Newline#Conversion_utilities that says that can be done by typing in Code: [Select]TYPE unix_file | FIND "" /V > dos_file I have a problem where php files have the wrong linefeed after uploading them via ftp. I'm looking for a way to do a batch convert on a nmber of files to fix this problem. I found this article http://en.wikipedia.org/wiki/Newline#Conversion_utilities that says that can be done by typing in Code: [Select]TYPE unix_file | FIND "" /V > dos_file that's code is working fine here. i tested out this .php file i obtain from net. when viewed in notepad, the line break show as SOMETHING like rectangle character. (ascii 10). after running the command type|find, the line break is properly fixed as ascii13+ascii10 character 13 is carriage return, character 10 is line feed. DOS uses crlf, Unix uses lf, and mac uses cr. An alternative method could be to upload the files using binary mode rather then text.Quote from: Reno on March 23, 2009, 11:16:07 PM that's code is working fine here. i tested out this .php file i obtain from net. when viewed in notepad, the line break show as something like rectangle character. (ascii 10). after running the command type|find, the line break is properly fixed as ascii13+ascii10I tried debug filename.php -d, using the full path for the filename. Right after pressing enter, it days file can't be found and then hangs. A ctrl z won't end it. Quote from: BC_Programmer on March 23, 2009, 11:34:34 PM character 13 is carriage return, character 10 is line feed.I've been fighting this problem for over a year. Others have suggested forcing the upload in ascii as well as binary. I've tried both ways but it dosn't make a difference. The problem is that sometimes I may have forty files with this problem mixed in with other files that are fine and of different types. So forcing an upload, even if that worked, would require more work than fixing each file manually and then uploading normally. I tried using sed to do it but can't get that to work either (nor could the sed groups I asked in). Then I ran across this command and thought my problems were solved. But I'm beginning to think this is a problem without a solution.This is one solution:http://download.cnet.com/Unix2DOS/3000-2381_4-10488164.html Thanks for the link. I wasn't AWARE of that program. It won't help since it only handles one file at a time but I did find one with the same name that says it runs in batch mode but it doesn't work as described. But that gives me something to search for. If two of these exists, there are PROBABLY others so I will keep looking. Thanks for all of the help. It did make a difference and I appreciate it. Sometimes solutions can be found outside of the box I just wanted to post the solution I found since it may help others. There is a free shell program named Flip - http://ccrma-www.stanford.edu/~craig/utility/flip/I added it as a button to my file manager app so I just NEED to select the files in question, click that button and it converts and uploads the files. I wouldn't have found it without the suggestions here so I truly appreaciate that. This has ended a very long battle. |
|
| 4594. |
Solve : Help with DOS command? |
|
Answer» HI all, Recently been assigned to understand some DOS command in order to enhance the batch files running in my company server. Below is a string of commands which i seriously do not understand: set APP_C=%1 set JOB_C=%2 JAVA -Xmx2M -Dant.home=ant -Dapp=%APP_C% -Djob=%JOB_C% -cp sny\lib\ant.jar;ant\lib\ant-launcher.jar;ant\lib\xml-apis.jar; ant\lib\xercesImpl.jar; org.APACHE.tools.ant.Main -buildfile RUN.xml %3 Erm, can I understand what does all these means? It seriously look greek to me. ='(Code: [Select]java -Xmx2M -Dant.home=ant -Dapp=%APP_C% -Djob=%JOB_C% -cp sny\lib\ant.jar;ant\lib\ant-launcher.jar;ant\lib\xml-apis.jar; ant\lib\xercesImpl.jar; org.apache.tools.ant.Main -buildfile run.xml %3 This starts the Java complier. Seems to run Apache, which is a DATABASE prog. Code: [Select]set APP_C=%1 set JOB_C=%2 This just sets "APP_C" to the first parameter, and sets "JOB_C" to the second parameter. Since this is on your company server i suggest that you don't mess with it until you learn some more on this. Hope this Helps ,Nick(macdad-) |
|
| 4595. |
Solve : Error Code Issue? |
|
Answer» I have a batch file where I call a .exe ah, somehow i miss that red coded line. so, have you create supress.vbs? and modify the batch code to : Code: [Select]start "" %comspec% /k "cscript//nologo supress.vbs" "D:\Program Files\cognos\cer4\bin\runmac32.exe" "D:\RM Bat Files\Build_Forecast_Cube.mac" change /k to /c when everything run smooth.check also the manual or HELP file of runmac32.exe. It may (or may not) provide details on how to put it in "quiet" mode. |
|
| 4596. |
Solve : How i can rewrap text?? |
|
Answer» Hi all!! import textwrapProgram print: "SyntaxError: invalid syntax" I use *.txt as "file" (I do it with my computer in house) Can you teach me? -I have other problem, I can't install any programming language on computer in my company. I use Wondow XP.Quote from: Star-Fire on March 26, 2009, 09:18:38 PM I don't know use python. When i install python and use your code. Program print: "SyntaxError: invalid syntax" I use *.txt as "file"the code is only used for ONE text file. if you want more that one text file, do it like this Code: [Select]import textwrap,glob for file in glob.glob("*.txt"): for line in open("file"): print '\n'.join(textwrap.wrap(line,30)) Quote I have other problem, I can't install any programming language on computer in my company. I use Wondow XP.if you can use USB, here's Portable python. Otherwise, you can just try to use vbscript. In that case, you would have to do a little bit of programming. 1) Open the file 2) Get each line, check total number of character 3) Divide them up by 30, which will give you how many lines there will be broken up. 4) Use a loop, do a substring , getting 30 characters each time...print them out , each time followed by a newline. 5) ....... Can I see your code for vbscript I want it can work more that one text file.Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject") strFile= "C:\test\file.txt" Set objFile = objFS.OpenTextFile(strFile,1) Do Until objFile.AtEndOfStream strLine = objFile.ReadLine strLengthLine = Len(strLine) For i=0 To CInt(strLengthLine /30) WScript.Echo Mid(strLine,1,30) strLine= Mid(strLine,31) Next Loop i would expect you to read up on how to use vbscript. Here's a linkit's not working as expected Code: [Select]1. katy perry - thinking of yo u.mp3 2. kelly clarkson - my life, w ould suck without you 2009.mp3 3. akon and kardinal offishall and colby o donis - beautiful .mp3 requirement 1: Quote from: Star-Fire on March 26, 2009, 11:01:44 AM 1. katy perry - thinking of requirement 2: Quote from: Star-Fire on March 26, 2009, 09:45:38 PM Can I see your code for vbscript I want it can work more that one text file.this should be easy. base on your latest posts history, i have doubt that you can write code as per requirement.Quote from: Reno on March 27, 2009, 12:17:02 AM it's not working as expectedworks for me. OP just needs to tweak it a little. Code: [Select]C:\test>cscript /nologo test.vbs 1. katy perry - thinking of yo u.mp3 2. kelly clarkson - my life, w ould suck without you 2009.mp3 3. akon and kardinal offishall and colby o donis - beautiful .mp3 can you actually write code? the OP is asking a really simple script: 1. read more that one text file, eg. read all the txt file in a folder, or read all the txt file based on argument passing 2. rewarp text in file .txt but don't trim word (only trim space) with specified width (eg. 30 width). the code you posted is rather a generic code to read file. example of what output the OP ask: string=1. katy perry - thinking of you.mp3 incorrect ouput: 1. katy perry - thinking of yo u.mp3 correct output: 1. katy perry - thinking of you.mp3 Quote from: Reno on March 27, 2009, 12:50:30 AM can you actually write code?what's the matter with you? do you seriously doubt i can't code? I am also not obliged to provide FULL solutions every time i post. I believe i have provided enough for him to follow through and do it on his own. If you want, you can do that, but i think you will not be helping him LEARN at all. So would you please get off my back? Quote from: ghostdog74 on March 27, 2009, 12:59:24 AM what's the matter with you? do you seriously doubt i can't code? I am also not obliged to provide FULL solutions every time i post. I believe i have provided enough for him to follow through and do it on his own. If you want, you can do that, but i think you will not be helping him learn at all. So would you please get off my back? Now now boys CALM down |
|
| 4597. |
Solve : Input hiding (different from password hiding)? |
|
Answer» In batch, a user will be entering a password to allow them access, but I want it so someone looking over their shoulder can't see the password (sortof like...not sort of like, exactly like password masking in VB)... HereThanks macdad, but I'm afraid that won't work (or I don't know how it could work). What I happens is the user enter's their username, then their password. If the username and password don't match a line in a file, then the user tries again, or gives up...Is there a way that it can MASK the input (like in visual basic), instead of doing it letter by letter?I believe it may be possible in VBScript.Quote from: macdad- on April 18, 2009, 03:22:40 PM I believe it may be possible in VBScript.I know absolutely nothing (usefull) in VBScript...can you show me how to/make it?I'm not knowledgeable in VBScript either. I think Ghostdog is good with it though. Quote from: macdad- on April 18, 2009, 04:37:11 PM I'm not knowledgeable in VBScript either.So, should I post this in "Computer Programming"?Your decision.Quote from: macdad- on April 18, 2009, 04:57:49 PM Your decision.Just did. Thanks for your help macdad-!Quote from: macdad- on April 18, 2009, 04:37:11 PM I'm not knowledgeable in VBScript either.ghostdog will only suggest you: - installs gawk, see my sig - if you are able to download stuffs, you can use sed (check my sig for link). - if you want to do programming/batching on windows, get a real programming language. - Switch to *nix then. -there are abundance of tools out there you can use. the unix Find command , which is ported to windows makes this kind of task seem trivial. - and many moreThat looks very hard to do. What is the ovjective? You want the user to type in a passwrod at a prompt from inside a batrch? The input must not have echo or just *** maybe? The batch file can retrieve the password from some place the average user would not guess. Right?Quote from: Reno on April 18, 2009, 10:51:39 PM ghostdog will only suggest you:for your info, i do GIVE solutions in vbscript sometimes. see here. Quote - Switch to *nix then.don't put words in my mouth. as for your other comment, i can only say, I advocate using right tools for the job ->> productivity. @helpmeh, see your other post and also here Quote from: Reno on April 18, 2009, 10:51:39 PM ghostdog will only suggest you: He surpassed himself in the other thread about this topic started by Helpmeh, by posting a link to Experts Exchange (plus the inevitable Perl script) gawk, or dawk? Quote from: Dias de verano on April 19, 2009, 02:57:37 AM He surpassed himself in the other thread about this topic started by Helpmeh, by posting a link to Experts Exchange (plus the inevitable Perl script)so do you have a problem with that? or are you purposely being irritating? take a hike. (or take your medicine if you haven't) |
|
| 4598. |
Solve : Listing Seven Character Text Files on Root Drive? |
|
Answer» Quote from: gh0std0g74 on May 09, 2009, 03:32:45 AM how do you define batch? give me a real answerQuote from: gh0std0g74 on May 09, 2009, 03:34:26 AM me too. Grow up for God's sake.Quote from: kpac on May 09, 2009, 03:35:19 AM Grow up for God's sake.you can't answer me? then where's is that justification that what i do is wrong?Quote from: gh0std0g74 on May 09, 2009, 03:36:39 AM you can't answer me? then where's is that justification that what i do is wrong? Exactly I can't answer you, because I don't know batch. But I do know how to run a forum.Quote from: gh0std0g74 on May 09, 2009, 03:32:45 AM how do you define batch? give me a real answer In DOS, OS/2, and Microsoft Windows, a batch file is a text file containing a series of commands intended to be executed by the command interpreter. The OP mentioned a C: drive, so it's a pretty fair bet he or she is using one of these. It is also a fair bet, since the OP appears to be seeking the solution to a school assignment, and from a careful reading of the question, that the desired outcome is to demonstrate competence in using fairly simple features, such as command output redirection, DIR switches such as /W and /S and wildcards. I think the assignment is more likely to find FILES of 7 characters or less in the filename. Quote from: kpac on May 09, 2009, 03:37:55 AM Exactly I can't answer you, because I don't know batch.wow, you do not know batch, BUT you can tell what's right or wrong? gimme a break. Quote But I do know how to run a forum.no you don't. If you are really running this forum, as in doing the administration/design etc..you would state clearly that anything other than batch are not allowed, only then I will not post in VBscript or any other languages i know.Wow, a FLOOD of TOPIC reports... Dias, Ghostdog, settle this elsewhere. That's what PMs are for. Topic Closed. If anyone WANTS this reopened for any reason, please PM me. Kpac is right in one thing. He doesn't go around trying to boost his post count with useless remarks. |
|
| 4599. |
Solve : Send data over ip ... if possible in dos ?? |
|
Answer» hi guys! if possible to send FILE to the over ip in dos ? send & receve file on dos ! like client Server.i think you will have to make it yourself, that's what i did... but my app was sending text instead of FILES, and was buggy like Quote from: Deadly D on May 25, 2009, 04:26:05 AM you will have to use tools already made for that , like ftp, sftp, netcat. etc. Or you can COOK up your own code using socket PROGRAMMING. Languages like Python, or PERL enables you to use socket libraries to program client/server applications with ease. |
|
| 4600. |
Solve : Replacing single lines in files? |
|
Answer» is it possible to use findstr to get a line is a file. then REPLACE that line with and edited line? is it possible to use findstr to get a line is a file. then replace that line with and edited line?findstr is not the tool to edit files. See here for few examples i gave to replace TEXT in files. if you want to try the vbscript, do some changes Code: [Select]..... strLine = objFile.ReadLine strLine=Replace(strLine,"SEARCH","replace") wscript.Echo strLine ....... ahh. thank you very much. it took a LITTLE bit for me to COMPLETELY understand but now i know. Thank you very much gh0std0g |
|