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.
| 7851. |
Solve : ghost batch script? |
|
Answer» i NEED some help regarding a script i want to use for restoring a ghost image fully unattended. this is a script i GOT from work. In this script there is a line which i do not understand: |
|
| 7852. |
Solve : Format C:? |
|
Answer» may have asked this before, but didn't see the answer if it came. |
|
| 7853. |
Solve : need help, should be simple... something like tokens? |
|
Answer» I need some help with a script I'm trying to write please. Ive been at this for days and Im not really getting anywhere, although I am getting to know cmd a lot better. C:\Users\Lemonilla\Documents\bat>find /?thanks Lemonilla. I just clicked how to read the help results, cheersQuote from: foxidrive on January 28, 2013, 08:14:39 AM
It takes the lines that command1 generates and uses FIND to separate the ones that have uuid: in them. The FOR then splits those lines up into 'words' by removing : and spaces (as delimiters) 2,* takes the 2nd word and then everything after the second word, and sets var to everything after the second word by incrementing %%a to %%b In your example it will do this twice, once for each occurrence of uuid: and will remember the last one.hey all. Thanks for explaining that Foxidrive. It seems this site is one of the only resources for learning msdos on the net. I found Dilberts tutorial and am having a good look through it. Theres a guy on youtube also, starkIndustries, hes very good, but, the tutorials cut off at a certain point. - a certain point before the level of foxidrive's command lol, it never gets that advanced. anywho, I tried the command this morning, and got a "The syntax of the command is incorrect." reply so i tried with with a SYSTEMINFO command in the parenthesis, and a different string to find, but the same error came back. it seems theres something slightly awry with the first line okay, if I take out the * and replace it with 3, - for /f "tokens=2,3" %a in (' SYSTEMINFO ^|find /i "broadcom" ') do set "var=%b" echo I like cats and %var% It works! woohoo! i get this C:\Windows\System32>echo I like cats and %var% I like cats and NetXtreme however, it requires that i hit enter after C:\Windows\System32>echo I like cats and %var% in order to get the next line, "I like cats and NetXtreme" which is not ideal. brilliant though, love it.The extra enter may be due to running it from command line, when I run it in a batch file, It doesn't pause (until my 'pause>nul'). Code: [Select]@echo off for /f "tokens=2,3" %%A in (' systeminfo ^| find /i "broadcom" ') do set "var=%%B" echo I like cats and %var% pause>nul Code: [Select] C:\Users\Lemonilla>cd ..\.. C:\>test.bat I like cats and 802.11n your right, I just had a go there and it ran through without pausing. If i may id like to as another question. the batch file im trying to create has in it three tasks. first is the one above, and the next are two delete commands. the scripts is one of many executed my anthill pro as part of a nightly software build. so, i have to add error handling, im a little bit confused about it.. so far my file goes like this, using the example above -------------------------------------------------------------------------------------------------- :: step 1 for /f "tokens=2,3" %%a in (' SYSTEMINFO ^|find /i "broadcom" ') do set "var=%%b" if there are no tokens - IF ERRORLEVEL 1 ( goto builderror ) echo I like cats and %var% :: below are to delete the directories ::---------------------------------------------- :: step 2 RD /S /q C:\CA\repositorydriver\directoryA IF ERRORLEVEL 1 ( goto builderror ) :: step 3 RD /S /q C:\CA\repositorydriver\directoryB IF ERRORLEVEL 1 ( goto builderror ) :builderror echo *** An error has occured executing clearRegistry.bat :exit |
|
| 7854. |
Solve : Input\Output Batch File? |
|
Answer» Hi,
To write to a file you can use '>>' or '>' Code: [Select]echo Hello, World! >>file.txt ping 127.0.0.1 >>output.txt echo %1 >>input.txt for /f %%a in (file.txt) do (echo %%a >>input.txt) [code] We will need a little more information as to the problem to better provide help.Following code will take input from same file and paste output in same file. FOR /F "usebackq tokens=*" %%a in ("log.txt") do echo %%a >> "log.txt"Basically i'm trying to individually add a large amount of users to 64 servers. so what i meant by input and ouput is that it shows you the command you running and the response it gives. If someone already has access to a server it STATES dsadd failed: already a member. Unfortunately some people used '0' instead of 'o' when inputting server names, so when i try to add them to that server i just get dsadd failed. Because of the large amount of commands being used, i cant see which command has failed Does that make sense?(same reply as elsewhere) You are running a batch file with the 'dsadd' tool in I presume. As long as it doesn't require keyboard input launch it like this: Code: [Select]batch.bat >dsadd-log.txt and then you can filter the log file with a command looking for errors and examine dsadd-error.txt Code: [Select]find "already a member" <dsadd-log.txt >dsadd-error.txtsorry im not using dsadd. Im using dsmod group -addmbr I dont understand the second part of what you said iv created a log file which is showing the comman added but its not showing the error I'm sorry for any confusion. I'm fine with getting the output from the batch file into a log file (> log.txt). My problem is that there are a lot of lines in the batch and the errors from dsmod do not show any detail about the issue. I'd like to show the commands from the batch file in addition to the output. My batch file looks like: command > log.txt command1 >> log.txt I know that I could do echo command > log.txt command >> log.txt echo command1 >> log.txt command1 >> log.txt but I thought there must be a way to tell command prompt to log the commands, as well as the output, to a file.... If I can see the command above the error in the log file, I'll know exactly what didn't work.You could try this: If the batch file starts @echo off either comment that line out like this REM @echo off or change it to this @echo on or delete it altogether Thanks for the advice. Won't this just output the commands to the screen though? I want to echo the commands to a file.If you are redirecting the whole batch output to a file (as in foxidrive's reply no. 7 above) like this... blablabla.bat > somefile.xyz ...then everything that would normally* go to the screen** will end up in the file. Try it. Did you say the error messages are ending up in the output file? * i.e. the stdout stream ** except error messages SENT to the stderr stream; some programs do this. If that is relevant to this situation it will become apparent I imagine. yeah i've tried that and it does exactly what you say. What im trying to do is get the errors that come with them so i know which one has failed. to an extent i've got the errors to send to a different file but its only showing one error instead of 4. Is this overwriting itself?I'm pretty sure it will over write itself if you use only 1 > instead of >>. But it's equally as likely I'm wrong. Quote from: AndrewUsh on February 05, 2013, 05:11:26 AM to an extent i've got the errors to send to a different file but its only showing one error instead of 4. Is this overwriting itself? need to see your code. Otherwise this is guesswork. |
|
| 7855. |
Solve : Create next Wednesday Month Year? |
|
Answer» I so crazy with this batch code for next Wednesday/Month/YR. The code will run every Wednesday 12:01 am will create next Wednesday. So I got that part next Wednesday work fine, but problem with create next month if this month at 02/27 with not change to MAR. Anyone have any ideas or different thought on this. Thanks I so crazy with this batch code for next Wednesday/Month/YR. The code will run every Wednesday 12:01 am will create next Wednesday This may help: Code: [Select]@echo off setlocal findstr "^:::" "%~sf0" > temp.vbs for /f %%i in ('cscript //nologo temp.vbs') do echo Next Wednesday is %%i del temp.vbs goto :eof :::WScript.Echo getnextDOW(vbWednesday, Date) :::Function getNextDOW(intDOW, dtmDate) ::: intTemp = WeekDay(dtmDate) ::: nextDOW = dtmDate - intTemp + intDOW + IIF(intTemp < intDOW, 0, 7) ::: getNextDOW = getLiteralMonth(nextDOW) :::End Function :::Function IIF(blnExpression, dhTrue, dhFalse) ::: If blnExpression Then ::: IIF = dhTrue ::: Else IIF = dhFalse ::: End If :::End Function :::Function getLiteralMonth(nextDOW) ::: arr = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec") ::: dtmDay = DatePart("d", nextDOW) ::: if dtmDay < 10 Then dtmDay = "0" & dtmDay ::: getLiteralMonth = dtmDay & arr(DatePart("m", nextDOW) - 1) & DatePart("yyyy", nextDOW) :::End Function This will compute the date of any next day of week. Use vbSunday thru vbSaturday to represent the week days in the script at line 10. Note: the IFF function comes straight from VB and prevents flagging the current date as the next DOW. Onward and Upward .I like this code, but how get out the month with uppercase "12FEB2013". Please help or have different thought. Thanks Quote @echo offQuote from: dtran on February 05, 2013, 09:17:32 AM I like this code, but how get out the month with uppercase "12FEB2013". Please help or have different thought. Thanks Make this change @echo off echo >"%temp%\%~n0.vbs" s=DateAdd("d",7,now) echo>>"%temp%\%~n0.vbs" m=MonthName((right(100+month(s),2)), True) echo>>"%temp%\%~n0.vbs" WScript.Echo right(100+day(s),2) ^& UCASE(m) ^& year(s) for /f "delims=" %%a in ( 'cscript //nologo "%temp%\%~n0.vbs"') do set day=%%a del "%temp%\%~n0.vbs" echo %%day%% is set to "%day%" (without the quotes) pause Thanks very much guys for help this code work. You guys so good . Finally I have the code below run very Wednesday at 12:01 am and create next Wednesday into a text file then sendevent that text file into gloval variables of Autosy. I just hopefully this 27/02/13 this job will run then create date 06MAR2013.TEL144821D. Thanks Salmon Trout foxidrive Sidewinder Geek-9pm Code: [Select]@echo off echo > "%~n0.vbs" s=DateAdd("d",7,now) echo >> "%~n0.vbs" m=MonthName((right(100+month(s),2)), True) echo >> "%~n0.vbs" WScript.Echo right(100+day(s),2) ^& UCASE(m) ^& year(s) for /f "delims=" %%a in ( 'cscript //nologo "%~n0.vbs"') do set nxtWday=%%a del "%temp%\%~n0.vbs" echo %nxtWday%.TEL144821D > nxtWday.txt ping -n 2 127.0.0.1 > nul for /f %%i in (nxtWday.txt) do sendevent -E SET_GLOBAL -G "FDB_TEL144821D=%%i" |
|
| 7856. |
Solve : Add Progress Spinner To Menu Batch File? |
|
Answer» Hello everyone!!! Im new to batch files and im wanting to incorporate a spinning progress to my menu of 9 choices. I can just call it but it runs the spinner then runs the ping. Im wanting to hide the ping and just show the spinner and display the packets failed or revived line. Any ideas? Thanks! Now I wanted it to not only for all GOTO's that I select that would ping have it show the (Waiting... /|\ ) while it was pinging the selection I made and when its done pinging then show the ping results.This is not possible, as far as I'm aware.Would be cool though.... Thanks everyone for the info!!! HI, Quote from: BC_Programmer on February 06, 2013, 06:11:15 AM This is not possible, as far as I'm aware.It's possible, but it's tricky. You need a second thread, so one thread do the work and the other displays the spinner. A second thread can be startet via start or start /b for the same window. But as I said, it's nothing a beginner should try. jebI wrote a simple sample for an asynchronous spinner and a smarter GetKey function, so you don't need to press enter. I suppose it should be obvious how it works. Code: [Select]@echo off setlocal EnableDelayedExpansion if "%~1"==":::" goto :spinnerThread :menuLoop <nul set /p menu=Select menu[1 or 2]= call :GetKey echo( echo Pressed '!key!' if !key!==1 call :menu1 if !key!==2 call :menu2 if !key!==2 call :menu2 goto :menuLoop :menu1 :menu2 call :spinnerStart rem do some work ping localhost -n 3 > nl call :spinnerStop echo Finished exit /b :spinnerStart del spinnerStop.tmp > nul 2>&1 start /b "" cmd /c "%~df0" ::: exit /b :spinnerStop echo dummy > spinnerStop.tmp :__spinnerStop if exist spinnerStop.tmp goto :__spinnerStop exit /b :spinnerThread for /f %%a in ('copy /Z "%~f0" nul') do set "CR=%%a" set "spinChars=\|/-" :spinnerLoop set /a "spinner=(spinner + 1) %% 4" <nul set /p ".=Waiting...!spinChars:~%spinner%,1!!CR!" ping localhost -n 2 > nul 2>&1 if not exist spinnerStop.tmp goto :spinnerLoop del spinnerStop.tmp > nul 2>&1 echo( exit /b :GetKey set "key=" for /F "usebackq delims=" %%L in (`xcopy /L /w "%~f0" "%~f0" 2^>NUL`) do ( if not defined key set "key=%%L" ) set "key=%key:~-1%" exit /b jebIndeed, it would appear my previous comment was premature: "testslashes.bat": Code: [Select]@echo off start /b slasher.bat ping www.google.ca -n 8 > redirected.txt 2>&1 echo "test">stopslash.dat echo "finished." :waitdel if exist stopslash.dat goto waitdel cls echo Finished! type redirected.txt slasher.bat: Code: [Select]@echo off if exist stopslash.dat del stopslash.dat :start for %%P in (^| \ - /) do cls&echo %%P&ping localhost -n 2 if exist stopslash.dat del stopslash.dat&goto endfile goto start :endfile testslashes is the "main" one. What it does is spawns off the "slasher" batch using start /b, then it uses a ping and redirects it to a file. While it is doing this, the slasher batch is writing the spinning cursor. When it detects stopslash.dat exists, it deletes it and exits. When the ping completes in the main batch, it writes out the stopslash.dat file, then waits for it to be deleted. and clears the screen and displays the results, which were redirected to a file. The 'slasher' batch just has the logic to keep looping until the sentinel file exists, at which point it deletes the file and exits. It also deletes it when it is entered to try to prevent issues. Wow thanks guys I REALLY appreciate it!! |
|
| 7857. |
Solve : Ssh and cmd? |
|
Answer» Hello right im unsure if this would work or not so bare with me |
|
| 7858. |
Solve : ftp over LAN? |
|
Answer» Is there a better way to transfer files over land via command line than ftp? |
|
| 7859. |
Solve : Find Drive letter for program files (86)? |
|
Answer» So this would give me a better ida then... HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0You can just do this Code: [Select]@echo off Set OSBits=64 IF %PROCESSOR_ARCHITECTURE%==x86 ( IF NOT DEFINED PROCESSOR_ARCHITEW6432 Set OSBits=32 ) Echo Operating System is %OSBits% bit Salmon, could you explain "IF NOT DEFINED" please. I searched and I cant really find anything on it. Thanks! Also I added Foxidives code to SAVE to temp and it works well. Thanks for that code as well Foxidrive!! Code: [Select]@echo off Color 2A Set OSBits=64 del "%temp%\64bit.txt" 2>nul IF %PROCESSOR_ARCHITECTURE%==x86 ( IF NOT DEFINED PROCESSOR_ARCHITEW6432 Set OSBits=32 ) Echo Operating System is %OSBits% bit do >"%temp%\64bit.txt" echo.You can use an IF test to see if a variable is "defined", i.e. if it has been declared, either by a SET statement or by the system (like %username%, ETC) The test is IF DEFINED variablename command. As with all IF tests you can test for the opposite (if it has NOT been defined) by inserting the word NOT after the IF KEYWORD. That variable only exists in a 64 bit session on a 64 bit system. Thus if it is not defined we might not have a 64 bit system. (You did know you can look all this kind of thing up on the web?) Type if defined batch into Google. Quote from: Salmon Trout on February 11, 2013, 03:47:14 AM (You did know you can look all this kind of thing up on the web?) Type if defined batch into Google. Yes I did a google search PRIOR to asking. I think by searching the entire phrase gave me limited results. Thanks again! Quote Salmon, could you explain "IF NOT DEFINED" please. I searched and I cant really find anything on it. |
|
| 7860. |
Solve : Batch file to execute a variable? |
|
Answer» hope you guys can help me..... |
|
| 7861. |
Solve : loop through text character by character? |
|
Answer» Quote from: Lemonilla on FEBRUARY 12, 2013, 02:40:35 PM I wrote it in Batch, as that is my most knowledgeable language, and the one I am most comfortable working with. It's time to UPGRADE your KNOWLEDGE. That is the next logical step for you. |
|
| 7862. |
Solve : Trying to install WIN98 from Dos & having issu? |
|
Answer» Okay, I got an HP from a friend of mine that they had wiped out because they had caught a virus. I am trying to install Windows 98 onto the computer from the CD Rom and I keep getting all these errors. the latest one said that I NEED to create an MS Dos boot partition to set up windows. Any ideas? The only things I have found is that I need to either disable Floppy Boot protection in the EZ Drive;& have no idea how to do this........ Or Disable the LANtastic Server or SuperStore Compression; again no idea........... Would APPRECIATE any advice/help.The easiest way is to enter bios & set your cdrom as the 1st boot device then boot your computer with the win98 disk in the cdrom. |
|
| 7863. |
Solve : How to restore a PCBACKUP.001 file dated 1990?? |
|
Answer» Hello word. |
|
| 7864. |
Solve : Pausing after "every screen"? |
|
Answer» I have Borland freecommandlinetools bcc32 but when i run it all of the output text scrolls to up fast after i run this and i cannot read this. I can SEE only half of output text, same problem with ilink32. I want to pause the program output, like it waits for keypress and then outputs/scrolls second half of output. I tried using /P and pause command but no luck. It just scrolls up this all and i cannot see text from top. I need it to turn off DEBUG information when linking exes. I remember i used some command for one app to do this but i don't remember what. Or if u know where to get full list of bcc32 and ilink32 command line options then please let me know. |
|
| 7865. |
Solve : PC TOOLS/PCBACKUP restore? |
|
Answer» Hi, |
|
| 7866. |
Solve : MS-DOS prompt? |
|
Answer» I am running XP home on a DELL pc. How do I get to the MS-DOS prompt?XP doesn't have TRUE DOS. It has a DOS emulator. |
|
| 7867. |
Solve : batch read character from text..? |
|
Answer» hi hello my Some characters will cause problems if your text is more than ALPHANUMERIC. In that case you will need some extra code. Just sayin'Quote from: Sidewinder on February 17, 2013, 11:36:18 AM I created a hello.txt file with the two lines you posted and used it as input. The script converts the two lines of hello.txt into a single data stream. This allows character 9 to resolve to 'n'. it's WORK! tnx |
|
| 7868. |
Solve : Re-config of comp & DOS question? |
|
Answer» I have stripped the HD of a COMPUTER, and now am in the process of installing 98 SE. |
|
| 7869. |
Solve : a batch file that regonize a file type? |
|
Answer» Hello guys, |
|
| 7870. |
Solve : net sending? |
|
Answer» how can i stop DOS net sending in my classroom? tnx... windows 2000Disable the Messenger service. Control Panel-->Administrative Tools-->Computer MANAGEMENT-->Service and APPLICATIONS-->Services |
|
| 7871. |
Solve : Backup batch? |
|
Answer» I'm trying to write a little backup script that I can have automatically execute with WINDOWS scheduler. I've got it working, but I'm trying to add some validation in so it'll tell me if it fails or not. It goes a little something like this: if %backup% == 1 suc == "" You probably mean this if %backup%==1 set suc= if %backup%==0 set suc=NOT Spaces matter in batch. ALSO you don't seem to understand the use of quotes. Batch language is not BASIC - you don't need to use quotes when assigning a string to a variable, unless you want the quotes to be part of the string. |
|
| 7872. |
Solve : Delete folders older than x days but preserve the most recent ones? |
|
Answer» Hi there, |
|
| 7873. |
Solve : Closing applications using dos? |
|
Answer» if at all POSSIBLE can i close already running applications from dos?other than dos |
|
| 7874. |
Solve : DOS COMMAND FOR WINDOWS 2000? |
|
Answer» Hi All |
|
| 7875. |
Solve : If exists errorlevel 9009 not expected? |
|
Answer» Hello, I'm trying to create a simple BATCH file that CHECKS to see if the file exists and then checks the errorlevel to see if it's open or not before proceeding. When I attempt to use the commands below I get the errorlevel==9009 when the file exists and is open or not and I'm not SURE why. |
|
| 7876. |
Solve : Shutdown the XP machine via batch file? |
|
Answer» In order to reduce electricity consumption, I wanted either to shut down the system and save the files before shutting it down. I want it to automatically save it and then shut it down. You cannot do this generically. How saving is handled depends on the program. Hibernation is the only alternative if you want to be able to restore state.I don't see hibernate option in Power Options folder. Any WAY out to make the pc go hibernate?Here's the batch file source: pause echo 1 shutdown /s /f echo 2 Yet the file seems to loop at the shutdown command. Here's the output from the batch file: C:\Documents and Settings\Kiley\Desktop>pause Press any key to continue . . . C:\Documents and Settings\Kiley\Desktop>echo 1 1 C:\Documents and Settings\Kiley\Desktop>shutdown /s /f C:\Documents and Settings\Kiley\Desktop>pause Press any key to continue . . .It's highly probable that you called the batch file 'shutdown.bat/cmd' Rename it to something else. |
|
| 7877. |
Solve : Very frustrated.? |
|
Answer» Is there ANYWAY in which to "start" a WINDOWS application using dos? |
|
| 7878. |
Solve : random character between every word in set /p? |
|
Answer» hi now i want set random character between every word.. this little snippet should help: Code: [Select]@echo off setlocal enabledelayedexpansion set /p var=Enter PW: set string=%var% :length if defined var (set var=%var:~1%& set /a length+=1 & goto length) set /a length-=1 for /l %%i in (0, 1, %length%) do ( call set chr=%%string:~%%i,1%% call :random if %%i EQU !length! (set outline=!outLine!!chr!) else (set outLine=!outLine!!chr!!rnd!) ) echo %outLine% goto :eof :random set intLowNumber=0 set intHighNumber=9 set /a rnd=%random% %% (%intHighNumber% - %intLowNumber% + 1) + %intLowNumber% I limited the random number to one character but that can easily be changed within the :random routine. The %random% variable only outputs NUMBERS so if you need random alpha characters let us know (no extra charge). Quote from: Sidewinder on February 18, 2013, 08:43:17 AM The nice thing about having a snippet closet is not having to actually write scripts, just assemble them from previous masterpieces! thanks sooo much that exactly what i wanted! one more question: Quote from: foxidrive on February 18, 2013, 05:30:54 AM how can i add alpha random character? tnxAs seen on TV: Code: [Select]@echo off setlocal enabledelayedexpansion set chrTable=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ set chrCount=52 set /p var=Enter PW: set string=%var% :length if defined var (set var=%var:~1%& set /a length+=1 & goto length) set /a length-=1 for /l %%i in (0, 1, %length%) do ( call set chr=%%string:~%%i,1%% call :random if %%i EQU !length! (set outline=!outLine!!chr!) else (set outLine=!outLine!!chr!!rnd!) ) echo %outLine% goto :eof :random set /a offset=!random! %% chrCount call set rnd=%%chrTable:~!offset!,1%% All the action takes place in the :random routine using the chrTable. The chrTable contains all the characters you want to INCLUDE for processing and the chrCount variable is the count of those characters. For example, currently the chrTable contains all the upper and lower case alpha characters and the chrCount is 52. If you want to include the digits 0-9, add them to the chrTable and increase the chrCount variable to 62. You can use any combination of characters you want, just be sure the chrCount variable is set correctly. Do not use special characters in the chrTable; many of them are used by the cmd interpreter and can and will create unexpected results. thanks |
|
| 7879. |
Solve : Install SMC1211TX Network Driver in MS-DOS 6.22? |
|
Answer» Hi, I have a K6-II 400 computer with MS-DOS 6.22. |
|
| 7880. |
Solve : Using Batch file to execute files from a CD? |
|
Answer» Hi! This is my first time creating a batch file so this might be a really dumb qs (applogies) |
|
| 7881. |
Solve : BAT file for Barcode Scanner (Accept input and place it into specific window/app? |
|
Answer» I'm looking to implement a barcode scanner at my current JOB. However the software that came with it isn't helpful when it comes to pointing the input in the right direction. I need a BAT file that will be triggered by only 1 COM port (USB). As of right now when I scan something it just enters the input as if it were typed on the keyboard. I just need to direct it to the correct window/application and have it press enter. This may be too complicated for a BAT file and maybe another language would be more appropriate. Any insight is appreciated! Thanks in advance. Zach Batch files can't be 'triggered' by a com port signal. Maybe if you explain a bit more we'd understand what it is you want to do. It's a bit hazy atm.I'm sorry for the confusion let me try and break it down a little better. I have a barcode scanner attached via USB to a Windows 7 PC. Right now: Whenever a barcode is scanned (Sales Order Number) it types in the number or value that it scanned to whatever window is active at the moment in Windows. (Word, Internet Explorer, Outlook, whatever is opened and active) What I need: I'd like to direct any input from the scanner, no matter what window is active at the moment of scan, to a specific application: UPS OZ Link. (Shipping Software) Lastly I'd like it to automatically send an Enter keystroke to submit the value that has been scanned and added to OZ Link. I hope this helps!Quote from: Zachareasy on February 27, 2013, 02:27:10 PM What I need: I'd like to direct any input from the scanner, no matter what window is active at the moment of scan, to a specific application: UPS OZ Link. (Shipping Software) Unless the scanner software supports COMMAND line switches, or configuration changes, to direct the output, then this can't be done when you are actively using other applications. The active window is the only PLACE the scanner data is going to, according to your explanation. The software it was BUNDLED with isn't helpful at all. I believe its purpose is to be bundled with a POS system and configured that way. Unfortunately this doesn't help us with what we're trying to do. I thought I'd ask because I'm not familiar with just how powerful batch programming can be. Thank you for your help I appreciate it! |
|
| 7882. |
Solve : Ms dos error? |
|
Answer» Hey i understand what you MEAN but could you possibly run me through the REPAIR using windows explorer?Personally I prefer the brute force method of the command line. |
|
| 7883. |
Solve : New to PC's and need to know how to undo a command in DOS? |
|
Answer» I am knew to computer's and I am in a class that is TRYING to teach me all the ins and outs of pc's.... We're having a test next week on MS DOS, I put in the COMMAND: MD \DOS LABS... and I keep GETTING a response saying that there is already a file under that name, so I put in the command: RMDIR \DOS LABS & now it's telling me the command could not complete because the file cannot be found. Can someone please assist me in getting past this?... Thanking you in advance... try putting the name in quotations, typing 'dir' to make sure the folder EXISTS, escaping the \, and using rd in PLACE of rmdir (don't know if this will make a difference, but it could).Greetings OrlandoE, |
|
| 7884. |
Solve : Erased harddrive, can't get DOS prompt? |
|
Answer» I erased my hard drive using Fdisk, because of some nasty virus and now I can't get a DOS prompt to re install windows 98se. I tried putting the BOOT DISK in and it doesn't read it,( I tried a new one from bootdisk.com also). After I power up it it goes through a couple of screens that seem to be checking vitals and I can get to the SET up screen (CMOS) but after that all I get is a screen that says " press any key to reboot" |
|
| 7885. |
Solve : batch file event sounds? |
|
Answer» since windows XP Pro does not have an event sound listed for the opening and closing of INTERNET Explorer I WOULD like to know if it is possible to create a BATCH file for this purpose. I have a few HAL9000 wav files that I would like to use so I can make my drab pc a little more interesting. My dos skills are on the newbie side but I am willing to give it a try. |
|
| 7886. |
Solve : format? |
|
Answer» Hi, |
|
| 7887. |
Solve : Batch File To Launch RunAsDate.exe? |
|
Answer» Hi To put it all into context, an IT dept have decided they are going to remove admin rights to Windows on the network for all users in the company.They're in charge of that for a reason. Are you trying to circumvent their authority? Explain to them this: Quote from: accessman on October 22, 2009, 02:28:17 PM Our reporting team runs databases overnight and if they crash we still need to be able to change the database time, without touching the windows clock etc. as we will not now be able to.If they don't agree, go up the ladder until someone does. Mate, I know and we're laying it all down and presenting issues and options. Our days of freedom and creativity are being replaced by distant checking and authorisation after a restructure. We are contractors and the setup is deliberately designed so that in the end we have to just get on with it. (Wait until a problem affects the bottom line). It's a recipe for disaster and very difficult to get the seriousness of it across. It's to ADMINISTER our own databases when we need to and won't affect Windows itself. They are being told about it and will hopefully see sense and agree to it.While you can, now is the time to look into... getting a new job somewhere else.Already am... in the 1980s I knew a guy who ran a circuit simulator on a VAX mini where he worked, they had to set the system date year back to 1986 because the trial period had run out...Nothing like that going on with this. If it all SOUNDS like b******t it's because it is. The problem, not the solution I might add.. I know that is old. But is unsolved. So the answer is: Code: [Select]@ECHO OFF cd "C:\Users\Neil\Documents\_Applications And System\runasdate\" RunAsDate.exe /immediate 21\10\2009 15:30:05 "C:\Program Files\Microsoft Office\Office11\EXCEL.EXE" exit Past the code on notepad and save as .bat Tested with: Windows 7 x64 RunAsDate 1.16 (32 bit) I'm speechless... |
|
| 7888. |
Solve : How to copy a range of lines? |
|
Answer» THANKS again foxidrive, that routine worked beautifully there's some pretty interesting CODE in that routine that i'm looking forward to STUDYING, so thanks again cos that GOT me kick started good! Have a great week and thanks very MUCH again! bk |
|
| 7889. |
Solve : ms dos problems? |
|
Answer» ???if anyone can help please do so. now going on to business. I erased my whole hard disk becuase my computer wasnt startin up and i did the whole format C: /s and fdisk stuff but everytime i start the computer it goes into ms dos and i dont really no what to do from here. when i try to write the down to go to the cd rom DRIVER [D:] the description says no specified driver or something around there. oh and i have TRIED H: and E: letters for the cd rom driver. NEED HELP BAD. I have a windows xp but i dont know what version it is now since i used a windows 98 boot disk . i think its windows 98 since it says that in the ms dos mode. My problem is getting the cd rom driver to work in ms dos since i have the windows 98 cd and getting the computer started into windows explorer. sorry for the long letter but i want to get a good answer so i gotta give a good description. Wow, what a great post... |
|
| 7890. |
Solve : Simple Batch script, help the noob!? |
|
Answer» I need a simple batch script and opens a program, then proceeds to click a folder and press control+S (control S makes the slideshow start) on that folder that then starts a slideshow with the contents of the folder. Compile to EXE Here is a link to the software that I use and was well worth the purchase price! * I have used some free ones before, but they were unstable when testing. You would tell it to perform a task and either timing would get messed up or the macro would malfunction and next thing you know your system is out of control OPENING up all sorts of stuff it shouldnt etc and the hotkey to kill it is not accepting input from keyboard etc. I haven't had that problem with this JitBit Macro Recorder like the free ones that are use at your own risk and unsupported. Jitbit is supported, I had to contact them about a minor issue which come to find out was because of my AMD Multicore CPU, and this issue was corrected in a later version which I was able to get a free update download for. http://www.jitbit.com/macro-recorder/I will give this program a try, thank-you!AUTOHOTKEY should do this quite easily. |
|
| 7891. |
Solve : Print to File? |
|
Answer» I have a DOS program that PRINTS to an Epson Dot Matrix Printer. Isn't there a DOS COMMAND that I can run before running the program to redirect the output from a printer to a PRN file? You might want to try this however: That command will redirect the output of your program to a file. If you want to print the printfile then PRINT filename.ext PRN is a parallel port device not a file. Is your Epson a serial printer? If so you can redirect it to COM1 with the MODE command: MODE LPT1:=COM1: Hope this helps. The following works: PRN2FILE [filename] [#] [/S] [/X] where filename - name of file to save captured data (default: c:\prnspl) #n - number of LPT (default: #1) /S - CONVENTIONAL memory buffer size in bytes (default: /S4096) /X - XMS buffer size in Kbytes (default: /X200) Thanks, Mark |
|
| 7892. |
Solve : Cleaning up TREE output to file? |
|
Answer» Quote The Tool may have been Karen's Print Directory...Hmm... I will have to check into that. I know she passed away a few YEARS ago, and her brother is keeping her site online now. It may have been her software. Her Registry Pruner SAVED my bottom back with Windows Me and a new HP Pavilion 700Mhz Celeron with Roxio 4 orphan registry entries from factory build. POINTING towards the image building department stripping a HIGHER end model that had Roxio 4 for this lower end model. Sure enough there it is in the list which corresponds with when he had this software. Still going to use the batch that was formed out of the HELP here though which can be altered if needed etc. http://www.karenware.com/powertools.aspIf the dir list is all you need then fine. but if Karen's tools provide a more extensive amount of info in a searchable format then it could be a better tool. After all, you don't want to process 300 cdroms more than once to get a list that you can manipulate. |
|
| 7893. |
Solve : backup copy? |
|
Answer» COULD you please tell me, how I can easy make a program which WOULD do the backup copy of certains programs / files in my computer. This should be done automaticly. I THANK You in advance! Whole books have been WRITTEN on the topic of Backup/Restore. Check out lessons #13-15 at: http://www.allenware.com/icsw/icswidx.htm Get back to US if you have any questions. |
|
| 7894. |
Solve : Need help with DOS sort command!? |
|
Answer» Hello, i'm trying to do what i THOUGHT would be a simple sort in a ".bat" file on Windows7 ie: |
|
| 7895. |
Solve : can't delete directories in msdos 5.0? |
|
Answer» recently acquired a "new' system. while TRYING to load win3.1, it stopped in the middle of the load. then TRIED to delete the windows directory but it will not allow me no matter what i try (dosshell or regular). how can i get RID of the unwanted directories without formatting the system?Create a bootable floppy: format a: /s Then BOOT from the floppy. You will have just ENOUGH of DOS to delete fiiles and remove directories. |
|
| 7896. |
Solve : how to create file in ms dos?? |
|
Answer» how can i create files in ms dos and then save it or copy it to DIFFERENT location?You can use notepad. |
|
| 7897. |
Solve : Dos placement problem? |
|
Answer» This isn't really a error message, since the dos problem doesn't affect the program. The problem is the program RUNS about two inches below the top of the screen CUTTING off the bottom two inches of the program. It all functions, but im unable to work them since i can't see them. |
|
| 7898. |
Solve : Connect to remote system and download the file? |
|
Answer» Hi |
|
| 7899. |
Solve : How to delete rows in a file with dos commands? |
|
Answer» I want to edit a HTML or text file. I want to delete some of the rows in this file and save it in the same directory where it existsDOS has no native commands for file editing. You can open TWO copies of Notepad and load your file into the first one. Highlight the text you wish to delete (atl-x) to cut the DATA out, then paste (alt-v) it into the second copy of Notepad. When you're done, save both files to the same directory. |
|
| 7900. |
Solve : BASIC batch commands will not work.? |
|
Answer» I am working on a WIN7 OS, using notepad++ and INFOPATH 2007. I am trying to do pretty basic things, but I keep getting the error of "WScript.Sleep is not recognized as an internal or externam command, operation program or batch file", when I run the .bat. You can also use 'ping localhost >nul' to make a delay, but it isn't really a standard amount of time. ping actually is pretty much one second per ping (plus you add one second overall) This is close to 15 seconds : ping -n 16 localhost >nul and this is close to 1 minute: ping -n 61 localhost >nul and this is close to 2 minutes : ping -n 121 localhost >nul Try this test - my results are below. Code: [Select]@echo off echo %time% ping -n 16 localhost >nul echo %time% ping -n 61 localhost >nul echo %time% ping -n 121 localhost >nul echo %time% pause 16:25:46.23 16:26:01.43 16:27:02.36 16:29:04.14 |
|