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.
| 4451. |
Solve : dos program error? |
|
Answer» I have a dos program created in foxpro for dos 2.6. It runs smoothly in WIN98 but when i TRY to run it in win2000 a message appear "Invalid database number". |
|
| 4452. |
Solve : Compatibility MS-Dos - 2003 Server ???? |
|
Answer» Hello all, |
|
| 4453. |
Solve : Rename duplicate files? |
|
Answer» Several people here at my office scan FILES onto their C drive during the day. At night time we run a batch file which will copy those files to a central file server. |
|
| 4454. |
Solve : Store each line of file content in an array? |
|
Answer» Hi Fellas, |
|
| 4455. |
Solve : nested files renaming? |
|
Answer» Hi all, |
|
| 4456. |
Solve : compute execution time? |
|
Answer» i don't know how to compute the time that it takes for a batch file to execute. |
|
| 4457. |
Solve : login password by Batch file? |
|
Answer» When I OPEN an application that is password protected using a bat.file, how can I have it automaticly enter the password in the login BOX. ex. OPENING a ms ACCESS datadase that is password protected.I doubt a batch file can do this. The batch file and the application are running in two separate data spaces. Try Windows Script which has a SendKeys method. |
|
| 4458. |
Solve : Bat file for play/eject cdrom? |
|
Answer» Old age.....i had it somewhere.....and now after**** years i decide to use it......but can remember the script..long script....is all i can give you.Merlin, |
|
| 4459. |
Solve : saving variable as a file for later use? |
|
Answer» Hi, |
|
| 4460. |
Solve : redirecting input in a DOS batch file? |
|
Answer» Hello, |
|
| 4461. |
Solve : Easy Q...Cant Find Answer? |
|
Answer» Hey peoples, |
|
| 4462. |
Solve : Compare listed files & get diff file names? |
|
Answer» Hi All, |
|
| 4463. |
Solve : Print from DOS Batch File? |
|
Answer» I am running a SQL DTS Extract to an Excel spreadsheet. I would like to print this spreadsheet from a DOS batch file so I can schedule it using Task Manager, but don't know the syntax. |
|
| 4464. |
Solve : Installing Driver for CD, with no operating system? |
|
Answer» I recently got a new hard drive for my Compaq Deskpro 6000, and installed a new CD-ROM, because the ORIGINAL one broke. |
|
| 4465. |
Solve : cmd programs? |
|
Answer» I have CMD in the C drive, not in any folders, and i want to open FIREFOX with it, but when I try to enter it(program files\mozilla firefox\firefox.exe) it SAY " ' Program' is not reconzined etc etc... i need helpFirefox is a windows program & it won't work on DOS. |
|
| 4466. |
Solve : USB Printer...? |
|
Answer» Hi, |
|
| 4467. |
Solve : starting in DOS? |
|
Answer» How do I shut down my COMPUTER running Windows XP and restart in DOS Hold down the f8 key on boot up......CMD PROMPT....its not dos anymore..... C:\> windows help /? and list of COMMANDS will appear if that is what you are after.... |
|
| 4468. |
Solve : How to get the first character of the argument? |
|
Answer» Hi All, |
|
| 4469. |
Solve : Save on a floppy with MS-DOS? |
|
Answer» If I need to save a document to a floppy from MS-DOS what do I do. |
|
| 4470. |
Solve : command for Bypass dos to BIOS call? |
|
Answer» Problem: |
|
| 4471. |
Solve : Computer Registry Question? |
|
Answer» (maybe this is the wrong forum, but HELP would be appreciated anyway!) |
|
| 4472. |
Solve : URGENT PROBLEM!!? |
|
Answer» lo, |
|
| 4473. |
Solve : shortcut key? |
|
Answer» For a batch file. |
|
| 4474. |
Solve : Here is a bat file code that makes your pc faster!? |
|
Answer» here is a bat code that clears all history and cookies on your pc.{makes it FASTER}: |
|
| 4475. |
Solve : Help..? |
|
Answer» How do I go from c:\Documents and Settings\Fam.jacks> to just c:\? Everytime I type c: it just goes back to c:\Documents and Settings\Fam.jacks>.. Pretty irritating, dunno what to do cuz I never use MS-DOS. |
|
| 4476. |
Solve : working on a bach for homwork to help clear thing up? |
|
Answer» I am trying to get a batch file work here is the codeCode: [Select]CLS Ghost wrote: So, naturally- you cannot use code tags? You'll only get a sore head, BC_P, if you bang it against this particular BRICK wall. Quote from: Dias de verano on March 21, 2009, 03:40:28 PM You'll only get a sore head, BC_P, if you bang it against this particular brick wall. you're probably right- it only looked like the MORTAR was CRACKING. Which is more important: The message or the vehicle? We all should be clones of each other? p.s. The code Tag was added. Don't worry; be happy. To be the same as my fellow Clones, I must get a Tattoo@billrich, please see picture of what it means to put your code in code tags. [attachment deleted by admin]To: Ghost Clone, Here is the code asked for by mdf1 in post # 1 above From: Bill Clone Code: [Select]C:\>type kay.bat @Echo OFF D: cd \ dir wu* Pause REM D: will take us from C:\ drive to D:\ drive; I do not have a K: drive cd wugxp Dir *.txt /w /p cd \ REM Cd \ will return to root directory D:\ cd wugxp\games Dir *.doc /w /p REM The following copy will copy D:\wuxp\games\ls.doc to C:\longshot.doc REM xcopy ls.doc C:\longshot.doc /v/w/r ( do you need xcopy? ) copy ls.doc C:\longshot.doc C:\> To: Ghost Clone, Here is the Output for the Kay.bat batch file: From: Bill Clone Code: [Select]C:\>kay.bat Volume in drive D is My Book Volume Serial Number is 0850-D7C5 Directory of D:\ 03/20/2009 09:24 PM <DIR> wugxp 03/20/2009 09:43 PM <DIR> wuxp 0 File(s) 0 bytes 2 Dir(s) 138,952,855,552 bytes free Press any key to continue . . . Volume in drive D is My Book Volume Serial Number is 0850-D7C5 Directory of D:\wugxp caavsetupLog.txt caisslog.txt christmas.txt count.txt date.txt db.txt disklog.txt for.txt homewk.txt Instruct_for.txt listone.txt list_of_program_files.txt log.txt noperiod.txt period.txt pipe.txt show.txt str3.txt task.txt temp1.txt testfilnam.txt x.txt xmas.txt xxx.txt z.txt zeke.txt 26 File(s) 828,670 bytes 0 Dir(s) 138,952,855,552 bytes free Volume in drive D is My Book Volume Serial Number is 0850-D7C5 Directory of D:\wugxp\games ls.doc 1 File(s) 4,195 bytes 0 Dir(s) 138,952,855,552 bytes free 1 file(s) copied. D:\wugxp\games>C: |
|
| 4477. |
Solve : Finding a specifc file across multiple drives? |
|
Answer» Sorry if this can be found elsewhere on the forum, but after a half dozen searches using VARIOUS phrases I couldn't find the answer. coding is base on your pseudocode: That's perfect! I knew that there had to be an "elegant" way of doing this, but finding good documentation on the use of the For command hasn't been easy. Many thanks!! - Henry |
|
| 4478. |
Solve : cleanmgr? |
|
Answer» Hi all What do you mean by 'Clean Disk'? clean the disk means: delete: - Download program files - Temporary internet files empty recycle bin clean setup log files and others you can see by opening cleanmgr thanks Try: cleanmgr /d drive_letter: hhhhh very very good thanks a lot what about RUN tha batch file in the back ground?You COULD use: Code: [Select]start "" /min batch_file_namethaaaaaaaaanks I run Window's Disk Cleanup a bit differently. I run the "Extended Disk Cleanup" using this shortcut: %SystemRoot%\System32\Cmd.exe /c Cleanmgr /sageset:35 & Cleanmgr /sagerun:35 It works great to remove much more JUNK than just cleanmgr by itself. But here's my problem,,,,, It automatically scans every drive in my system and that's SIX. That wastes a lot of time. I only want it to scan drive C: and then quit. I've tried putting /C: in the line in several places but nothing works. It still scans all drives. Does anyone know how to force it to scan C: and then quit. Shadow Did you try: Code: [Select]%SystemRoot%\System32\Cmd.exe /c Cleanmgr /d C: /sageset:35 & Cleanmgr /sagerun:35 |
|
| 4479. |
Solve : Help needed to write simple batch program? |
|
Answer» I need to create a batch program which will call a particular executable FILE, change some options in that file, and then execute it. What screens pop up exactly?Quote from: confusedgalvandana on March 19, 2009, 02:47:06 AM But this opens a window in which i have to select an option from the drop down list nt dos doesn't have drop-down list, so it's certainly a windows program. no, you can't click-clack-click windows prog from cmd.exe. another option is to write the code in wscript (already installed by default), or download 3rd party software, such as autoit, or write it in high-level language, such as VB, VC++, etc. which one do you prefer?Thank you for replying Yes, the program that i'm trying to run IS a windows program. Well actually, the application that we automatically want to invoke is itself coded in VC++, so i'm guessing i should somehow change the code of that application such that it takes the option i want by default? The problem i have though, is that the code is extremely complex to understand and i cant figure out where the code for the dropdown list exists among all the project files and workspaces... Can i code in VC++ the default options i want...and bypass the rest of the windows (2 of them) coz all i have to do is click "ok" on them both. I want to bypass that and move onto the third screen which is the actual executable. At the same time i want to auto-invoke that application....which is why i thought i should use batch programming. Any thoughts on this?if you have the source code, why would you code the 2 DialogBox in the first place? since it's not going to function anyway. Comment the line(s) where it create the instance of 2 DialogBox, then rebuild the executable. Quote from: confusedgalvandana on March 19, 2009, 06:44:10 AM At the same time i want to auto-invoke that application....which is why i thought i should use batch programming.create a shortcut in desktop or start menu??? this make me wonder if you did write the code yourself.I did not write any code in that application...it's an already existing application for which i downloaded the source code(freely available on the same site) and i have been working on for the past couple of weeks...i am just using the application...but i want it to conform to particular conditions....which it is not.. And by auto-invoke....i meant that it should start without any person having to click on it....the kind of application that i am developing needs a person to be monitored continuously...i want my program to check for a few conditions and if they are satisfied, i want this application to be invoked. The name of the application i'm working with is Machine Perception Toolbox(MPT). I have already mailed the authors of the software too....but awaiting reply. All i wanted to know was if its possible to write code such that in the first two windows "ok" option is selected so that directly the 3rd window is displayed.Quote from: confusedgalvandana on March 19, 2009, 07:21:19 AM And by auto-invoke....i meant that it should start without any person having to click on it....the kind of application that i am developing needs a person to be monitored continuously...i want my program to check for a few conditions and if they are satisfied, i want this application to be invoked. I may be wrong but it sounds like you are trying to have a program start and monitor what some one is doing with out them knowing. If so there are already programs out there that will do this. Is this for a company or home?Hey...no...the person knows he is going to be monitored...basically we are using a tool that allows us to monitor and count the rate at which a person blinks (which may SOUND kinda stupid! but thats what we wanna do).. Anyways the screenshots are attached. > In the screenshot, the first one opens automatically....i want to find a way to automatically select "blinkDetector" from the dropdown list and "ok" to be clicked so that it directly opens the 2nd dialog box. And this is not for any company, its a project i've taken up, thats all. Please help!! [attachment deleted by admin]In the first place, is it even possible to manipulate applications involving windows dialog boxes using batch programming?? Quote from: confusedgalvandana on March 19, 2009, 11:32:34 PM In the first place, is it even possible to manipulate applications involving windows dialog boxes using batch programming??from my few months experience in Batch, i am certain the answer is no. but if someone know how to control windows program from pure batch, i really realy want to know how to do it. here is the vbs code: (untested, i dont have the software) Code: [Select]with createobject("wscript.shell") .run "c:\program files\your exe program here",1,false:wsh.sleep 1000 if .appactivate("Projects") then .sendkeys "{down 4}~~" else wsh.echo "Unable to activate Projects" end if end with to run it double click the vbs file in windows explorer. or type in command prompt: cscript//nologo auto.vbs or wscript//nologo auto.vbs if you want to auto-invoke, you could put it in startup folder, or modify registry in the run section, or use a taskscheduler. because you have the source code, you could modify it also. but reading someone else source code is a very very tedious job. |
|
| 4480. |
Solve : Changing delimiter in a text file.? |
|
Answer» Hi All well- there is unxutils, found here: 1) Microsoft services for unix 2) Cygwin and 3) GNU for Windows I use the Core Utils http://gnuwin32.sourceforge.net/packages/coreutils.htmnot to forget these tools also 1) FindUtils for windows , the find command much better than WINDOW's version 2) DiffUtils , for comparing files and such. 3) Gawk, Sed as mentioned. 4) Grep. For a full list of available unix commands for Windows, check out this directory |
|
| 4481. |
Solve : Trying to make a batch file need help? |
|
Answer» The first batch file I NEED help with is to use REPLACEABLE parameter that will accept a file name from the command line and list the contents of that file using a pipe command for example: the user types in User list the contents of the user file.doc will list and pause between pages The computer I am using is window vista Text editor is notepad++Code: [Select]@echo off Thank for the Help the code seems to work what is that *.fil part for? to bring up any of the file with the ext of .fil. I tried using wild card but it brought everything up on that drive and I only need a specific ext. Quote from: Dias de verano on March 19, 2009, 12:35:07 PM Doing his homework but he'll get the grade not you. However there is a gotcha in that code which the OP may or may not discover... was that intentional? (Let's not spell it out) I think so too Quote from: mdf1 on March 19, 2009, 02:04:17 PM to bring up any of the file with the ext of .fil. I tried using wild card but it brought everything up on that drive and I only need a specific ext. You don't UNDERSTAND what a replaceable parameter is, and your teacher will see that and be able to help you, which is good. So let's LEAVE it like that, eh folks? i should have asked him if it was homework. but oh well.... |
|
| 4482. |
Solve : how to create log file? |
|
Answer» hi yes i have write the end of the line at the end of your ftp command: Quote from: rihan on March 17, 2009, 10:30:58 PM ftp -s:test.txt servername >> logfile.txt |
|
| 4483. |
Solve : help with Batch file which just stops?? |
|
Answer» Hi All thanks with all the help so far ! I was wandering if this is due to needing to wait for the encrypt program to finish, however any tasks i put after the encrypt are not called so how would you guys recommend i get round this issue? hello cmd_noob, any message box being shown by SWFencrypt? press CTRL+ALT+DEL, and check if the program is still responding? there is version 5 available here: http://www.amayeta.com/software/swfencrypt/Thanks i checked the task manager and it seems the thread for swf encrypt is still running when i open another cmd and kill it, the batch file continues and does what is supposed to do. The only problem is that i cannot put a Taskkill after the swf encrypt as the task willnot run ?? Strange oh and i am running 4.0strange..... when you run this swfencrypt with the COMMAND line switch -overwrite, does the application run as a windows program or console application?? you should look into why this swfencrypt doesn't QUIT after it has finish encrypting the swf file. and does it actually finish encrypting the file? try to delete this file manually before encrypting "C:\Documents and Settings\tester\Desktop\mainDirectory\%GAMENAME%_main.swf". EXAMPLE of Executing Windows Program: c:\MsPaint.exe - this statement will return as soon as the MsPaint Form is loaded c:\start/wait MsPaint.exe - this statement will only return when you Close/Exit the application c:\start %comspec% /c mspaint.exe - this statement will run mspaint.exe in a new window cmd. so if this swfencrypt is executed as windows program, it should be returning once the form is loaded.Hey Reno I am running it like swfencrypt.exe"C:\documents and...." and it seems to run in a console state. I have tried everything, it's crazy. It does however work if i manualy start up the program and then find the swf file. Thanks Reno Seems like there is a problem with swf encrypt as it works but hangs for like 10 mins before killing the process |
|
| 4484. |
Solve : Help with batch file please !!!? |
|
Answer» Hi everyone I have had a read on these forums (and loads others!) CD "C:\Program Files\SWFEncrypt 4.0\swfencrypt" -overwrite "C:\Documents and Settings\tester\Desktop\RandomFolder\%GAMENAME%_main.swf" remove the "CD" from the above line so it become: "C:\Program Files\SWFEncrypt 4.0\swfencrypt" -overwrite "C:\Documents and Settings\tester\Desktop\RandomFolder\%GAMENAME%_main.swf" make sure %gamename%_main.swf existThanks for quick reply just tried that and the error has now changed to "the system could not find the path specified" However the path was coppied from the address bar from the top of the directory? Is there anything that can be seen as wrong from the above code? Thanks again!remove/comment @echo off to start debugging. change: IF EXIST "C:\Documents and Settings\tester\Desktop\RandomFolder\%GAMENAME%*" GOTO ENCRYPT to IF EXIST "C:\Documents and Settings\tester\Desktop\RandomFolder\%GAMENAME%_main.swf" GOTO ENCRYPT does this path is correct? C:\Program Files\SWFEncrypt 4.0\swfencryptthanks for yor help, I started taking appart line by line to see what was causing the problem. I found out iw was this line : cd "C:\program files\SWF Encrypt 4.0\swfencrypt" -overwrite "C:\Documents and Settings\tester\Desktop\randomFile\%gameName%_main.swf" and have since changed it to this: CD "C:\Program Files\SWF Encrypt 4.0 swfencrypt "C:\Documents and Settings\tester\Desktop\randomFile\%gameName%_main.swf" this seems to encrypt the file as expected however strangly the batch file then freezes and does not continue onto the next set of instructions? thanks to all your help it seems to work (although not quite as planned) but i think there is something wrong with the ecryption program as it takes about 10 mins to kill the task...... OH well need to search for a more compatible piece of software Thanks agin for all your help!! |
|
| 4485. |
Solve : Dual Boot Windows XP and MS DOS 6.0? |
|
Answer» Greetings I have a bootable CD of DOS Illegal. DOS 6 was only distributed on Floppy. Quote from: Ralph Spencer on March 17, 2009, 11:47:45 PM Greetings performing the described commands will also erase everything on your C: drive- including windows. If your I: drive is a USB drive then you are out of luck. Thanks for help. Luck is REFUELED. I: Drive is a partition on my HDD.DOS MUST be installed first. it only UNDERSTANDS FAT. (not fat32- just fat16). the partition must be at the beginning of the disk as well. C: would be DOS 6, and then you can install XP on the remainder of the disk (D:)- XP will automatically install it's OS selection menu for you.Thanks.. I'll try.. |
|
| 4486. |
Solve : Pls help with path independent batch files? |
|
Answer» hey all |
|
| 4487. |
Solve : REG ADD Problem? |
|
Answer» Hello |
|
| 4488. |
Solve : Batch coding - which command to use?? |
|
Answer» hmm.... SOMEBODY should write a small program that does the same thing as GetTickCount() and uptime, but instead uses QueryPerformanceFrequency() and QueryperformanceCounter().well, so if it measures time since system is up, how is it possible to measure time elapse between command executions? Quote from: ghostdog74 on March 18, 2009, 04:13:21 AM well, so if it measures time since system is up, how is it possible to measure time elapse between command executions? subtraction.Quote from: ghostdog74 on March 18, 2009, 04:13:21 AM well, so if it measures time since system is up, how is it possible to measure time elapse between command executions? You should read the code I posted earlier. I reproduce a relevant portion Code: [Select]set /a elapsed=%finshtime%-%starttime%Quote from: BC_Programmer on March 18, 2009, 04:10:57 AM hmm.... somebody should write a small program that does the same thing as GetTickCount() and uptime, but instead uses QueryPerformanceFrequency() and QueryperformanceCounter(). Beware http://www.virtualdub.org/blog/pivot/entry.php?id=106 Ok ... so i see what you are doing. its the same as using %time% except that %time% doesn't give you millseconds.Quote from: ghostdog74 on March 18, 2009, 04:22:20 AM that's not what i meant. What i meant is, you are taking the milliseconds from the tickcount.exe output correct? and what does this milliseconds mean? Is it the time since the system is up and running, or is it the time elapsed between 2 execution of a code. your system may be up since yesterday and assuming you have not shut down the computer, you are running this code only today. So is tickcount used for the correct purpose? it is the time since the system is running. you run it once. you store that value. you run some code to benchmark. you run it again, storing the new value. you take the difference between the values, thus getting the number of milliseconds that elapsed while the code was running. Anyway, I decided to go ahead and implement a QueryPerformanceCounter program; attached. run it without parameters, and it returns the current value given my QueryPerformanceCounter. run it again, passing in the value RETURNED previously and it spits out the number of seconds that have elapsed... with quite a number of decimals, I might add... [attachment deleted by admin]Quote from: ghostdog74 on March 18, 2009, 04:22:20 AM that's not what i meant. What i meant is, you are taking the milliseconds from the tickcount.exe output correct? and what does this milliseconds mean? Is it the time since the system is up and running, or is it the time elapsed between 2 execution of a code. your system may be up since yesterday and assuming you have not shut down the computer, you are running this code only today. So is tickcount used for the correct purpose? Tickcount measures the time that the system has been up and running. It does not MATTER if the computer was started yesterday or even last week, since the INT32 value rolls over every 49.8 days. Quote from: ghostdog74 on March 18, 2009, 04:22:20 AM Ok ... so i see what you are doing. its the same as using %time% except that %time% doesn't give you millseconds. Mine does, well TENS of milliseconds, which is really what tickcount does. (it only has 10 msec accuracy) Code: [Select]C:\>echo %time% 10:37:03.34 Quote from: Dias de verano on March 18, 2009, 04:38:40 AM Mine does, well tens of milliseconds, which is really what tickcount does. (it only has 10 msec accuracy)not that accurate. though i never really got my hands dirty yet, i believe you can get "uptime" through the Win32_OperatingSystem->LastBootUptime. then going through Date formatting to get milliseconds. anyway.....Quote from: ghostdog74 on March 18, 2009, 04:48:14 AM not that accurate. though i never really got my hands dirty yet, i believe you can get "uptime" through the Win32_OperatingSystem->LastBootUptime. then going through Date formatting to get milliseconds. anyway..... you can, but it is simply wrapping around the GetTickCount() API. As shown here: http://msdn.microsoft.com/en-us/library/ms725473(VS.85).aspx chances are any "uptime" properties/routines are merely calling GetTickCount() and processing the result. (actually, chances are they are actually calling GetTickCount64()...so we are suddenly using third-party tools now ? whaddya mean? |
|
| 4489. |
Solve : vbs to delete files |
|
Answer» I found this vbs submitted to this forum by Sidewinder on August 8, 2008: |
|
| 4490. |
Solve : .bat networking test? |
|
Answer» I'm trying to create a .bat file to use for networking support. The file will run a ipconfig /all, tracert, ping and output the results to a file. but would like to think there's a more direct way. By redirecting STDERR back to the STDOUT data stream, you should be able to trap the message and implement plan B. Code: [Select]@echo off for /f "tokens=* delims=" %%v in ('ping www.google.com ^> C:\ping.txt 2^>^&1') do ( if /i "%%v" equ "Access is denied." echo Implement Plan B ) The literal message must be spelled exactly as issued by the OS. It is not case sensitive. Hope this helps. |
|
| 4491. |
Solve : FTP (again...)? |
|
Answer» I know this is getting a bit old. Whenever I ask about FTP, people always put the commands/username/password into another file. I can't do that (While remaining secure). Can the commands STAY in the batch file?I don't think so. The STDIN device is normally assigned to the keyboard device. It can be redirected to a file, however if you redirect it back to the FTP batch file all those pesky batch commands will be interpreted incorrectly in the FTP shell. I don't think so. The STDIN device is normally assigned to the keyboard device. It can be redirected to a file, however if you redirect it back to the FTP batch file all those pesky batch commands will be interpreted incorrectly in the FTP shell.So what you are saying that FTP in batch must be: Code: [Select]ftp -s:file.ext ftp.host.com What I am asking is can I put all the commands that WOULD be in file.ext in the batch file?There is a way of keeping it in the batch, but its no more secure than having it in a separate file, you still need the login details in plain view. You will have to google it, but essentially it involves tacking the CONTROL file on to the end of your batch -- heres a link to one example http://www.dostips.com/DtCodeBatchFiles.php#Batch_FtpBatch Good luck GrahamQuote from: GPL on March 12, 2009, 04:36:51 AM There is a way of keeping it in the batch, but its no more secure than having it in a separate file, you still need the login details in plain view. The people I am dealing with aren't smart enough to know how to "decompile" a exe (from a .bat). I'll check the link ASAP.Quote from: Helpmeh on March 11, 2009, 12:11:24 PM I know this is getting a bit old. Whenever I ask about FTP, people always put the commands/username/password into another file. I can't do that (While remaining secure). Can the commands STAY in the batch file?the "proper" ways to do it, 1) use SFTP (secure FTP). Using Keys instead of password. 2) still using windows FTP client, BUT giving proper access control to whoever needs to execute the batch. Whoever has no business meddling with the batch file, will not be allowedQuote from: ghostdog74 on March 14, 2009, 09:35:20 AM the "proper" ways to do it, What??? The people who will be running the batch file don't know enough about batch to know how to "decompile" it...so as long as I "compile" it to a .exe , they can't see the code. I don't want them to download anything that they don't need to. What do you mean for the SECOND part?Quote from: Helpmeh on March 16, 2009, 07:58:37 PM you will never know if a person is smart or not smart. don't assume. trust me. Quote What do you mean for the second part?I don't know how you are using FTP. you just want your users to do file transfers to your servers?? it might be better to shed some light on what you are doing with the file transfers. Quote from: ghostdog74 on March 16, 2009, 08:17:49 PM you will never know if a person is smart or not smart. don't assume. trust me. The people who I am dealing with have absolutely NO knowledge of DOS whatsoever. What I am doing with FTP is, 1. Appending a file 2. Getting a file Pretty simple... So what do you mean for this? Quote from: ghostdog74 on March 14, 2009, 09:35:20 AM 2) still using windows FTP client, BUT giving proper access control to whoever needs to execute the batch. Whoever has no business meddling with the batch file, will not be allowed |
|
| 4492. |
Solve : Silent URL PopUp?? |
|
Answer» hello i hope SOMEONE can help a NEWB with this |
|
| 4493. |
Solve : Possible to check for other 'open' dos windows with a batch file?? |
|
Answer» I'd like to run 2 batch files over 24 hour period. The batch files should finish in 2 hours and are separated by more then 6 hours. However, in the event that one stalls, I want to be able to exit any NEW batch files if a new batch starts when the other batch FILE is still running. My question: Is it possible to check for other open dos windows in a batch file and if so how? |
|
| 4494. |
Solve : Day of the Week? |
|
Answer» Quote from: Reno on March 16, 2009, 04:03:28 AM the first solution you post at 1:50 failed on year<1900 and year>2100 why does it FAIL? Oh hold on... I think I know why... Quote For /f "delims==" %%N in ( ' cscript //nologo evaluate.vbs "weekday("1/1/2009")" ' ) do set daynumber=%%N Instead of ENCLOSING the dates as a STRING, use date literals: Quote For /f "delims==" %%N in ( ' cscript //nologo evaluate.vbs "weekday(#1/1/2009#)" ' ) do set daynumber=%%N tests SEEM to work from the year 100 to 9999, with various month and day combinations. Not to take away from the pure batch solution of COURSE |
|
| 4495. |
Solve : How to change the size of the window in a batch file? |
|
Answer» This is a frequently asked question so I thought I might POST this. |
|
| 4496. |
Solve : Directory Date?? |
|
Answer» I wonder if someone could help me slve a SLIGHT problem. |
|
| 4497. |
Solve : data stripping? |
|
Answer» Hi all 6. I dont have any other tools, programmes on the PC other stand standard dos commands. - and cant load any other programmes either. did you really mean standard dos?? or is it win nt cmd.exe (the black box window that some people mistakenly think is dos). i dont have a solution for standard dos, but the following code is tested on: C:\>ver Microsoft Windows XP [Version 5.1.2600] Code: [Select]@echo off & setlocal for /f "skip=4 tokens=2,3" %%a in (test.txt) do if not defined vtime set v%%a=%%b echo adef -l %vsize% -h %vtime% Quote 1. log onto PC2 via PC1 using telnet Logging on to a computer using Telnet could potentially be malicious. Reno did you really mean standard dos?? or is it win nt cmd.exe (the black box window that some people mistakenly think is dos). > cmd.exe it is. & many thanks for the help with the code, i will try it out. BatchFileCommand Logging on to a computer using Telnet could potentially be malicious. > These comps are all behind very heavy firewalls, and can only "talk" to each other. Thats why telnet is a viable OPTION, and the only option. I get a logon prompt thats always the same (we use pragma telnet server) the only thing that would be different is the user input for the username and password. So any help in performing that task would be great. Many Thanks so far Dalii dont have telnet access to try. type telnet -help or telnet /? to see if anything intresting can be found there. and paste the help info here. also try this code to see if it can pass username to telnet. echo usernamehere|telnet hostnamehereCode: [Select]echo usernamehere|telnet hostnamehere Or you can do this: Code: [Select]echo %username% | telnet hostnamehere That is a system set variable that automatically puts your user name.lQuote from: dali1972 on March 06, 2009, 10:06:34 AM 6. I dont have any other tools, programmes on the PC other stand standard dos commands. - and cant load any other programmes either.sorry, but this is a rant. I don't see why you can't load any programs that makes your programming life easier. If you are a programmer doing a batch job like this for your company, you can have your boss approve the use of those tools. doing telnet automation with sucky telnet client from windows just doesn't cut it. What happens after this ? Code: [Select]echo usernamehere|telnet hostnamehere you are expected to execute some commands on the other side. The above statement is not enough to do all that. Get a real programming language that have libraries that supports the Telnet protocol with proper error control. your boss should understand you have these restrictions. |
|
| 4498. |
Solve : set info in text file to variable? |
|
Answer» hi all, when I run this I get the last line of the file. any ideas? Devcom's code gets the 2nd line OK for me. However, here's a slightly different way Code: [Select]@echo off setlocal enabledelayedexpansion set /a line=0 for /f "delims==" %%L in (file.txt) do ( set /a line+=1 if !line! EQU 2 set var=%%L ) echo 2nd line is %var% wbrost, I have not written any code since 1992. And the code I wrote was was usually UNIX shell script or C. So forgive my comments if we both don't benefit. If the file name is different each time, then a command line argument will help. For example: C:\>2line homewk.txt file name homewk.txt 2nd line is " Write a batch file that display a welcoming message before displaying your C:\>type 2line.bat @echo off echo file name %1 setlocal enabledelayedexpansion set /a line=0 for /f "delims==" %%L in (%1) do ( set /a line+=1 if !line! EQU 2 set var=%%L ) echo 2nd line is %var% C:\> p.s It helps me when an example of the output is listed. Good Luck with you projectthank you to all that helped out. I have made the following to access the Active Directory computer description. You will need to edit the code to point to your AD. Code: [Select]@ECHO OFF CLS SETLOCAL ENABLEDELAYEDEXPANSION :LOOP CLS ECHO please enter computer name ECHO. SET CN= SET /P CN=Computer Name: REM TESTS TO SEE IF HOST IS ACTIVE SET ERRORLEVEL= PING -n 1 %CN% > nul REM PING ERRORLEVEL OF 0 MEANS SUCCESS REM PING ERRORLEVEL OF 1 MEANS THE HOST IS NOT FOUND OR TURNED OFF IF ERRORLEVEL 1 GOTO fail IF ERRORLEVEL 0 GOTO ADQUERY :fail CLS ECHO. ECHO. ECHO host %CN% non responsive or not found ECHO please try again PING -n 1 -w 5000 1.1.1.1 > nul GOTO LOOP :ADQUERY REM command to gather information from AD dsquery computer [AD OU] -name %CN% | dsget computer -desc > %temp%\computerdesc.txt REM Will access text file and set the second line to %var% setlocal enabledelayedexpansion set /a line=0 for /f "delims==" %%L in (%temp%\computerdesc.txt) do ( set /a line+=1 if !line! EQU 2 set var=%%L ) CLS echo. echo. echo %var% DEL /Q %temp%\computerdesc.txt pause > nul thank you, wbrost |
|
| 4499. |
Solve : Delay???? |
|
Answer» all i NEED is a 5 sec delay how do i do thisCode: [Select]PING localhost -n -5 >nulwill that have any effect on my css server THATS runing on the same computer since your pinging?I KNOW nothing about CSS. Sorry.>~sleep.vbs echo wsh.sleep wsh.arguments(0) 'ms |
|
| 4500. |
Solve : Installing the Setup file? |
|
Answer» Can u please help in installing the setup file in silent mode. |
|