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.
| 8251. |
Solve : Redirecting only a few lines to a file? |
|
Answer» Hello, |
|
| 8252. |
Solve : Renaming and reading PDF files? |
|
Answer» Hi the names of the pdf-files are 20071119-0001.pdf, 20071119-0002.pdf, 20071119-0003.pdf, etc There seems to be a pattern here where the file name of each PDF file ends with contracter number minus two leading zeroes. Perhaps this pattern information could be useful in WRITING your script. Thanks for your response. I tried to do exactly as you told me, but it does not work yet. First I tried a normal read, but the variable text gives only garbage: Dim text, readfile, contents set readfile = FSO.OpenTextFile(src, 1, False) '1=ForReading text=readfile.Read (38) Then I tried 2 SkipLine and a ReadLine, but again, garbage: Dim readfile, contents set readfile = FSO.OpenTextFile(src, 1, False) '1=ForReading contents = readfile.SkipLine contents = readfile.SkipLine contents = readfile.ReadLine MsgBox "contents:" & contents Also the .readall method gives garbage: Dim readfile, contents set readfile = FSO.OpenTextFile(src, 1, False) '1=ForReading contents = readfile.ReadAll readfile.close 'determine contractnr in 3rd line of pdf-file dim pos pos=InStr(contents,"contractnummer: ",1) The value of contents is: "%PDF-1.4 %äüöß 2 0 obj <</Length 3 0 R/Filter/FlateDecode>> stream xœ}PËjÃ0¼ë+ö°º«ÇZ!pÒøÐ[@ÐCé-mo…ø’ß?´²›%Íìcf?šà¬N€€åå¯-Gz€ùÞ7ðÛjå›Ô6+Ï:@ï?î!áe""0ùû#""%ŠhRg""Ztè+åEè8¦ÎÆVܦ¢í„s!ŸùMí³:ükHN›fh€ÌjXG? »\…Æ}#,¾|“Aä?BÄAxñøw7ý¼{}Ú¯«ˆâ½_ºòžÊæ?IÒ?Ëð$”PÚÜÓ³9°æ‡³©?ý|{«?ü|²d—”#¹´&$ŸjÇ=™¯±pÌÁtÆ endstream endobj 3 0 obj 238 endobj 5 0 obj <</Length 6 0 R/Filter/FlateDecode/Length1 26468>> stream xœí|y\TGºhU?Óûvš¥7ú@Cƒ4‚Š(‘FÀ%ÜБZieínD'Nâ³™ÌdŸ‰f™ì‰-Mrãd½Y?É2'‰&1Û̽ó2ÉÍ""ý¾ªs01sçÞ÷þx¿ßKªÎWU_U}õmõU5õ? ""ùÚºü½+Λµ!ô*B8¡mCD¼éíüc" like I said, garbage It doesn't make a difference whether the code says: set readfile = FSO.OpenTextFile(src, 1, False,0) set readfile = FSO.OpenTextFile(src, 1, False,-2) set readfile = FSO.OpenTextFile(src, 1, False,-1) (the last number, 0, -1 or -2 , indicates the format of the file. The code does read textfiles, so I think it has to do with the pdf files, but I don't know how to fix it (=how to read the content of a pdf-file in vbscript). To answer your question, yes, the contractnr: is only in the 3rd line. (And the pdf-files I'm currently working with, the ones with "contractnr: 000001", "contractnr: 000002", etc, are just test files. In reality there are different contracts scanned as pdf and there is no pattern in their contractnumbers, so that's why I want to read the pdf-files: to read the unique contractnumber, and to give the pdf-file the name of that contractnumber. Hope you have any more suggestions on how to read the contractnumber of a pdf-file (by the way, it is also possible to scan the files as jpg or TIF-files instead of pdf-files, but I think it is impossible to read a contractnumber from a jpg or tif-file). BEST, Leonard I should have removed my post as soon as I realized that PDF files are not your normal text files (duh! ). In fact they are proprietary Adobe files. You will need to find (use Google) an ActiveX component (either a DLL or OCX module) which can handle PDF files, specifically reading them. I found many for creating PDF but they are quite pricey ($$$). Good luck. another way is to convert pdf files to text for reading you can download tools from 3rd party such as xpdf and others. after converting,you can read them using your script. If you have experience is other scripting languages such as Perl/Python,there may be modules for reading PDF files, you can try them also. |
|
| 8253. |
Solve : Cmd, batch file, cant use Ftp, why?? |
|
Answer» i'm making a BATCH file, and i use @FTP in it, but after that no CODE will work anymore, why?What operating system are you using? WinXP or.... ? |
|
| 8254. |
Solve : i cannot open command prompt at all...? |
|
Answer» i`m having problem to open command prompt. is there is new virus or anything that can disabled this program( command prompt ) too?are they those WHOSE make this virus really genius, why they so genius?please HELP me....theirs a way to DISABLE command prompt maybe this is what happend.. to find out |
|
| 8255. |
Solve : NET USE COMMAND? |
|
Answer» need help abt NET USE COMMAND..........pls....C:\>net use /? |
|
| 8256. |
Solve : Escape codes in batch files? |
|
Answer» Hello, |
|
| 8257. |
Solve : need help with this code...? |
|
Answer» I'm making a message encrypter and i need it to allow me to enter the message i want encrypted and have it spit out the encrypted form of the message. Is this possible? and if so what command can i use? I'm making a message encrypter Do you mean you are writing a program, if so which language are you using? If not, which encryption program will you be using? I understand that the XP EFS is available only in the Pro version. Lots of free encryption programs and info on the WWW - Google for 'message encryption' (without the quotes'). As for the command to use - the supported commands at the XP Command Prompt are here. its just a simple batch file that i am creating... no need for internet downloads its just for me and a friend this is what i have so far... and btw i went to the link to it didn't help... Code: [SELECT]@ECHO OFF REM This program is used to convert the "thermalvison" encryption. :PASSWORD SET /P CHOICE= Please enter password... IF '%CHOICE%'=='AB10069' CLS GOTO CHOICE1 IF '%CHOICE%'=='666' CLS GOTO FAKE ECHO "%CHOICE%" IS AN INVALID PASSWORD. GOTO PASSWORD :CHOICE1 SET /P CHOICE= To ENCRYPT type "e". To decrypt type "d". IF '%CHOICE%'=='e' GOTO ENCRYPT IF '%CHOICE%'=='d' GOTO DECRYPT IF '%CHOICE%'=='secret' GOTO SECRET ECHO "%CHOICE%" is not a choice. :ENCRYPT CLS SET /P CHOICE= Please enter the message you wish to encrypt. IF '%CHOICE%'=='A' ECHO T IF '%CHOICE%'=='B' ECHO H IF '%CHOICE%'=='C' ECHO E PAUSE exit please help this forum is still open. |
|
| 8258. |
Solve : help help help {no fixed disks present}? |
|
Answer» due to virus problems i used fdisk to format C and now when i use a start up disk i get [drive c does not contain a valid fat or fat 32 partition] and says to use fdisk to create a partition but when i try to enter fdisk i get i get [no FIXED disks present] HELP ! Here is Microsoft on the subject. |
|
| 8259. |
Solve : Deleting multiple unknown subdirectories ?? |
|
Answer» Hi, And i quote: my badNp Diablo461 Quote from: GPL on November 20, 2007, 09:45:11 AM Try this Thanks again gpl : ) |
|
| 8260. |
Solve : TRACERT? |
|
Answer» Ok, I've known about tracert for a while, but I have no IDEA what it actually does (or at least, no informed idea: I can guess some use). Anyways, can someone explain to me exactly what it does and how to use it? |
|
| 8261. |
Solve : How to caputre txt from a .exe based on buffer size? |
|
Answer» Good-day, |
|
| 8262. |
Solve : How to find Process/service?? |
|
Answer» Hello |
|
| 8263. |
Solve : Batch File functionality? |
|
Answer» What I need in a sense is to have a batch file open notepad and save it in a directory? Is it possible to have this task repeated daily?open notepad and save it in a directory? how do you mean.. |
|
| 8264. |
Solve : Litestep? |
|
Answer» so heres the problem |
|
| 8265. |
Solve : C:\> Documents and Settings? |
|
Answer» When I FIRST OPEN DOS, I'm prompted with [C:\> Documents and Settings\Ehucker>] and it won't LET me go to [C:\>] by itself, can someone hel me? I want to get to [C:\>].all you gota do is TYPE cd\ |
|
| 8266. |
Solve : Locked files? |
|
Answer» Is there a way to see what files are locked and by whom?I not sure if Windows or DOS keeps TRACK of locked files. A very inelegant solution would be to get a LIST of the files and then attempt to open each for reading. If successful, you'd KNOW the file was unlocked and if unsuccessful, you'd know the file was locked. |
|
| 8267. |
Solve : IF EXIST & COPY to archive before XCOPY /s/d/y stomps on backup target location? |
|
Answer» Help NEEDED for archival of files in batch |
|
| 8268. |
Solve : cd.. then c..how to open MSDOS using cd prompt? |
|
Answer» HI! How to open MSDOS using CD prompt.I typed cd.. and then c.. but it is invalid directory. Thank you!PLEASE rephrase your question. What is it you WANT to ACCOMPLISH? |
|
| 8269. |
Solve : accessing windows root directory from dos? |
|
Answer» I need to replace a corrupt .dll file in the windows root dir of XP I get an access DENIED message when attempting to CD to that directory. Is there a way around this?Shouldn't be any dll's in the root directory... I need to replace a corrupt .dll file in the windows root dir of XP I get an access denied message when attempting to CD to that directory. Is there a way around this? |
|
| 8270. |
Solve : how to install net send service? |
|
Answer» I want to USE net start COMMAND but I don't know how to install . Please I assume you're on Win XP... |
|
| 8271. |
Solve : DOS Kill All Command?? |
|
Answer» If I do a NETSTAT command and see a connection that is established and I want to KILL it, what command do I USE. Also is there any good DOS tutorial anywhere on the web? |
|
| 8272. |
Solve : Can any one help me make a restarter bat file with w timer for 5 minutes? |
|
Answer» I want to make a bat file to open a program, and then in 5minutes it CLOSES and then it RESTART right FATER it closes, but 5 minutes later it crashs again |
|
| 8273. |
Solve : where can I get sources of command language? |
|
Answer» I don't which use COMMAND LANGUAGE. for example, to OPEN add and remove program box, i don't know how to open in cmd. Can someone GIVE sources that explain FACTIONS of commands in system32. |
|
| 8274. |
Solve : How to get the file size? |
|
Answer» Hi all: |
|
| 8275. |
Solve : set num1 = %num1% + 1? |
|
Answer» yeah this is SOMETHING I've been thinking about, I might not find a GOOD use for it but I like to try this KINDA stuff out in case I get any ideas... |
|
| 8276. |
Solve : DIR verbose in WinXP as in Win98?? |
|
Answer» Back in good old Windows 98 SE (MS-DOS 7.1) I used to backup file lists with the command: ... Or is there a simple downloadable exe for this purpose? Maybe. At least it is free, so you can check it out to see if it does everything you need. There is a for-pay version, but I've never even looked into whatever advantages it claims. See: http://www.no-nonsense-software.com/freeware/ Look for PrintFolder It is great. I use it on Win98SE. I've been told by a reliable source that it works fine on WinXP systems too. Since it is free and simple to use, your best BET is to simply grab a copy, install it, and play around with it to see if you like it. For me, it is one of the standard things I want to have handy on any computer I mess with for very long. Let us know if it fulfills your need. Of course when I had found out this change in Windows XP I searched the available switches for command dir both in its help and on various sites. Well, Microsoft's Command-line reference A-Z has nothing new to dir/?. I have found a few useful utils at Slovak Antivirus Center most of them single exe files not requiring installation but none of those seemed to be the right one. Quote from: WillyW on November 14, 2007, 04:37:51 PM Look for PrintFolderWith the advanced options I could create a list containing all the required columns. Because of the different file sizes in space aligned plain text mode the column width is not the same for each subdirectory so the format output has to be set to delimited list to make it ready to be imported in Excel. Yes, it fulfills my needs. Quote from: mn1995 on November 24, 2007, 01:49:24 PM
Excellent! Thanks for POSTING back the good news. |
|
| 8277. |
Solve : Error in your file CONFIG.SYS in Line 1...A beginners question? |
|
Answer» What does it mean? is it the reason why my computer is not STARTING? I got a problem about my computer and I see that written when I start my pc...can someone tell me why my PC isn't starting? before my PC WENT down the graphics of my PC was odd...I never seen it like that before...it was somehow a little bit reddish.Can't tell YET... |
|
| 8278. |
Solve : How to use a batch file to enter a username and password on webpage? |
|
Answer» Hello!! OK, I'm a newbie and haven't delt with dos in years. So FAR I've got a batch file started that will open IE and goto the username box. But what I haven't FIGURED out how to do is: |
|
| 8279. |
Solve : PLEASE HELP trying make .bat to delete temporary internet files at every startup? |
|
Answer» i have made a batch file to run at start up... this batch file cleans internet tracks, by deleting history and want it to delete temporary internet files as well. My delima is that the temporary internet file folder is a read only file shown in the properties, in the explorer. when checking the attributes from a comand prompt, it is shown as a hidden,system file. I have tried to change attributes on the folder, as well as the files from a command prompt, using the (attrib +a -r -s -h c:\tempor~1 /s) command. The hard drive rattles no error messages or other messages for that matter. when i went to look in the windows explorer the read only is still checked. Can anyone help me edit the attributes of this folder.. I know there is programs to help do this, but i'm not interested in another program... I only want to know if it is possible to change the attributes on this folder and keep them changed when REBOOTING... Maybe i should be in programming,,, but i know nothing about programing, so if there is programming involved , i'll have to be spoon fed the instructions,,, if u know what i mean....THANKS...WEW delete the contents of the folder instead , c:\tempor~1\*.* I have tried to change attributes on the folder, as well as the files from a command prompt, using the (attrib +a -r -s -h c:\tempor~1 /s) command attrib /? Displays or changes file attributes. ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. [drive:][path][filename] Specifies a file or files for attrib to process. /S Processes matching files in the current folder and all subfolders. /D Processes folders as well. Try using the /D to set attributes on a folder. Note: when deleting files, it may not be wise to delete the folder the files were in. Ok I must be missing something... I have reset the attributes. i can recheck from a command prompt. The attrib are reset to archive, when i close the cmd prompt. then i go into win-explorer it still says read only on the properties. when i restart the pc the attrib is set back to system at the command prompt... some one please help...and thought i might also add, after setting the ie 6.0 to dump files when browser is closed, i still SEE files in it that are 4 days old. This is why I want to have the power to delete these files with a batch file...I guess i'm back to manually deleting them to be sure....I also tried what sidewinder suggested....no help after reboot they are reset back to the system attrib. |
|
| 8280. |
Solve : Web Address Redirect? |
|
Answer» I am not a computer expert and I thought someone here could help me. My old evil roommate got into my DOS screen and redirected several websites I frequently visited to Google. When I returned home my DOS screen was open with a bunch of STUFF I did not understand but I did SEE the website addresses that were affected. For example when I put "www.myspace.com" in the address bar the Google website is on the screen. The address in the address bar does not change. |
|
| 8281. |
Solve : Finding DOS commands entering area foe xp windows? |
|
Answer» How do you reach the DOS commands section/page on xp windows.?Welcome to the CH forums. |
|
| 8282. |
Solve : Backup with a batch file: How to mirror destination with source ?? |
|
Answer» I'm running Windows XP and I've just wrote a batch file for backing up my stuff on an external hard-drive. I use the XCOPY command with the following switches: /D/E/I/H/K/Y. |
|
| 8283. |
Solve : How to copy file in network(using DOS)? |
|
Answer» helo im new here.....this is my first POST.. |
|
| 8284. |
Solve : Batch file question (copy and paste)? |
|
Answer» Dear all, |
|
| 8285. |
Solve : Delete files older than 7 days? |
|
Answer» I browsed through the entire forum and saw this question has been asked/answered several times. However, I'm not smart enough to get it working in my case. I'm using xcopy to copy folders every night through a batch job, & rename takes care to name these copied folders on the system date. CD\C:\Backup This little ditty merely sorts a directory listing of files that have the archive bit set. After skipping the first 7 files in the list, it proceeds to delete the rest of them. Quote echo off Not really up-to-date with the forfiles command, I'm guessing this will delete files dated either today or yesterday. This little routine may actually do what you need: Code: [SELECT]Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder("c:\backup") Set colSubFolders = f.SubFolders For Each objFolder in colSubFolders ShowFiles objFolder Next Sub ShowFiles(Fld) Set k = fso.GetFolder(Fld) Set s = k.SubFolders Set kf = k.Files For Each objFile In kf If objFile.DateCreated < date - 7 Then Wscript.Echo objFile & " " & objFile.DateCreated End If Next For Each SubFolder In s ShowFiles SubFolder Next End Sub As written the snippet will simply list the files older than a week. Save the file with a vbs extension and run as cscript scriptname.vbs Once your satisfied that these are the files you intend to delete, replace Wscript.Echo objFile & " " & objFile.DateCreated with fso.DeleteFile objFile, True and run the job again. Good luck. Hi Thank you I didn't follow the line 'run as cscript scriptname.vbs". I saved the vbs as test.vbs. What am I exactly supposed to do after this? Another q, the server doesn't allow VB. Is it POSSIBLE to achieve this using a batch file ? Will wait for your response.My machine is Windows 2003 Server. So, do you think this should work? forfiles /p c:\backup /s /m *.* /d -7 /c "cmd /c del @file : date >= 7 days"Yes, you would run the script as cscript test.vbs. When you are satisfied that these are the files to delete, make the code change and re-run the job. I guess scriptname should have been in italics. While your machine may not have VB installed, VBScript is installed on all Windows versions since Win95C. Code: [Select]FORFILES v 1.1 - [emailprotected] - 4/98 Syntax : FORFILES [-pPath] [-mSearch Mask] [-ccommand] [-d<+|-><DDMMYYYY|DD>] [- s] -pPath Path where to start searching -mSearch Mask Search files according to <Search Mask> -cCommand Command to execute on each file(s) -d<+|-><DDMMYYYY|DD> Select files with date >= or <=DDMMYYYY (UTC) or files having date >= or <= (current date - DD days) -s Recurse directories -v Verbose mode The following variables can be used in Command : @FILE, @FNAME_WITHOUT_EXT, @EXT, @PATH, @RELPATH, @ISDIR, @FSIZE, @FDATE, @FTIME To include special hexa characters in the command line : use 0xHH Default : <Directory : .> <Search Mask : *.*> <Command : "CMD /C Echo @FILE"> Examples : FORFILES -pc:\ -s -m*.BAT -c"CMD /C Echo @FILE is a batch file" FORFILES -pc:\ -s -m*.* -c"CMD /C if @ISDIR==TRUE echo @FILE is a directory" FORFILES -pc:\ -s -m*.* -d-100 -c"CMD /C Echo @FILE : date >= 100 days" FORFILES -pc:\ -s -m*.* -d-01011993 -c"CMD /C Echo @FILE is quite old!" FORFILES -pc:\ -s -m*.* -c"CMD /c echo extension of @FILE is [emailprotected]" I have no experience with forfiles, so I may not be the best one to ask. Best I can recommend would be to test out your code in a test directory until it works. Good luck. |
|
| 8286. |
Solve : pause and fake pause? |
|
Answer» can i make one of those flashy things at the end of a echo command? |
|
| 8287. |
Solve : Print Screen batch? |
|
Answer» I am looking for a way to use a batch program for easier screen shots. I have the basic format, but need help with the specific commands. I have the basic format,can you elaborate on this? It would help to understand what you are doing so far. I have seen the paid and shareware versions of screen shot programs. I was hoping that there would be something already in the OS, so that a third-party would not be involved. The Basic premise is: Command to take screen shot Ability to open Paint program. Paste the screen shot from the clipboard to Paint. Save the file a unique name (based either on random letters, or sequential with compare to others existing). Close Paint program. I was hoping for a way to program, so that I can be playing a game, and at anytime the screen is captured (via hotkey), and saved somewhere. Having the ability to make sure that FILENAMES are not duplicated, I can be on the game and take multiple shots without having to manually save them.Interesting chore that you wish to accomplish. I don't know how to do it, as you've described though. Let's see if somebody else comes along with a different idea. Back in the days of 'Good Old DOS", There were some neat little jewels laying around that were called "KEYBOARD stuffers." They were small, simple, and adequate. (And limited). I don't know if they will work with modern OS's, but a little poking around might find something that will fit the bill. You've nothing to lose, so why not do a little research and see what pops. Tony McNamara's "Keypress" might be a good place to start.yes but there is also a problem with this... when you open the batch to take the shot, it will be opened on your screen, therefore taking a shot of itself. and as of a full screen game, when you open it it should automatically minimize the game you have running to take the screenshot, taking a shot of your desktop and the batch.Thanks for the heads up 2k_dummy. I will look more into that. Very nice obversation, gamerx365. Having DOS pop up at anytime will take an application out of full screen. It may not be able to be done full, but having the ability for the app in Windowed Mode, would be an option I would be willing to live with, if it works.Years ago I wrote a little TSR that intercepted the PrtSc interrupt, snatched the screen, and wrote it to a file instead of sending it to the printer. This was strictly for TEXT-based DOS 6.22 and probably any version back to 3.10. It would not work with a screen in graphics mode, which is what you seem to be describing. And it is a batch solution only insofar as it is loaded from the command line or in autoexec. Quote from: NewbieOldSchool on November 21, 2007, 07:55:56 PM Thanks for the heads up 2k_dummy. I will look more into that. ? I thought you were not interested in third party utils. What I had in mind was something exactly like what JosephMansfield has mentioned - a TSR. I'd have to look around... it has been a while... but I remember there were some out there. But, like JM said, they too might have problems with a windowed session. JM: Was yours freeware? is it available anywhere for d/l, if someone reading along here would like to experiment with it? Can it also be unloaded from the command line? WillyW : I wrote commercial programs which used a text-only interface. My TSR allowed me to snap pictures of the program screens, then include those screen shots in manuals and help screens. It appended all screen shots to a single file so there was no need of multiple catch files. There was no provision for unloading, once it was loaded. If you would like a copy to play with, I'd be glad to send you both source code and .COM code, just give me an address and I will email it or send it via transferbigfiles. I think there is a way on this forum to respond directly to me without broadcasting your address. WillyW, I would prefer that it is not from a third party, but if the coding for that particular one was available, it could give me a direction on how to code it myself. Joseph, if you could help me understand the relation between DOS and graphic programs, it would be much appreciated. You mentioned that it would not work with a screen in a graphics mode, but it could be the first piece of the puzzle.Graphics can show you pictures on the screen, smiley faces, fancy lettering, etc. Text-only is just that -- you see letters, and maybe a few lines, but that is all. When you have your paint program up, that is graphics. If you open a DOS box (run CMD.EXE or COMMAND.EXE), that box is text only. I know DOS and text video down to the bare metal, but I quit reading when Windows came out, so I really can't tell you any more than I just did. My TSR won't help you. But after I close this, I'll see if I can send email to you and if so send you the code for the TSR so you can see for yourself. I think the bottom line is that the way you are doing the job now is as good as it GETS. Windows does not lend itself to automation of repetitive tasks the way DOS does. |
|
| 8288. |
Solve : Xfer files to an HTTPS network share via DOS???? |
|
Answer» I have a CLIENT with a https WEB server who needs a new file uploaded every day. I don't WANT to keep doing this manually so I'd like to write a simple dos batch script I can schedule to do this for me. Sounds simple enough, except, I can not figure out how to access "My Network Places" in DOS. |
|
| 8289. |
Solve : Adding the Number Files & Size to a Folder Name..???? |
|
Answer» Is there any way at all with a BS or VBS to auto rename a folder by ADDING the Total size of the folders contents & the total number of files within it to the Folder's name..?? diruse. Also the dir command lists out the total number of files at the very end of the OUTPUT. Find a way to grab that value |
|
| 8290. |
Solve : How to save the text using >? |
|
Answer» Hello, |
|
| 8291. |
Solve : Second part of my batch file? |
|
Answer» Good-DAY, |
|
| 8292. |
Solve : need to run from cmd can you help?? |
|
Answer» I've been asked to do this: |
|
| 8293. |
Solve : MS-DOS Switches? |
|
Answer» I am new to this forum, and I am hoping I am posting this topic in the correct spot. I am having an issue that I am unfamiliar with. I am creating a batch file for a group policy, so when a user logs onto the network a certain program will run. The path in the batch file is S:MITC2000\T-Tracs\CLKINOUT.EXE S "SC" Here's another shot-in-the-dark 'cos you haven't even said what Operating System you are using!!!! Will assume XP in one of its variants. The path quoted just has to be wrong as /\ : * ? " < > and | are not valid in filenames. So, if your default directory is C:, then that is where subdirectories/files will be sought. Suggest your path should have a \ after S: so that the path is S:\MITC2000\T-Tracs\CLKINOUT.EXE S "SC" What the S "SC" parameters for clkinout.exe do will be explained in that program's documentation. Good luck. Edit: Oh, welcome to the CH forums.Dusty, I do apologize for the lack of info. Yes, you were correct in assuming that the OS was XP, actually professionel. In the original post I did post a syntax error in the path. Thanks for correcting me. To give you a little more background on this issue: I am trying to write a batch file that can be used in the group policy of the active directory, so at logon this program will automatically start when the user logs onto the network. Right now they use a shortcut icon on there desktop to open this software. By the way all of our workstations are XP Professional, and our servers are 2003. The program is located on the S: drive, which is network drive, and is mapped at user logon. The shortcut icon that the users now use have this information in it: Target: S:\MITC2000\T-TRACS\CLKINOUT.EXE S "SC" and START IN: S:\MITC2000\T-TRACS. I found in the documentation to the software that the S in the Target area directs the CLKINOUT.EXE to our database files in the SC directory. This is the part that I can't figure out. It seems that in the batch file it will not direct the executable to the SC directory. When I do run the batch it executes but then loses the SC directory location and trys to FIND the database files in whatever default directory it can. Example: if I run the batch from My Document folder on my WORKSTATION it will look in My Documents for the SC directory instead of on the S:\ drive. Even though the executable is running from the S:\ drive. Any Ideas? Thanks for the welcome. I can tell that I will be using, and hopefully giving advice alot on this forum. I will probably not be of much help with your problem as I'm not at all familiar with Clkinout.exe but... Quote Example: if I run the batch from My Document folder on my workstation it will look in My Documents for the SC directory instead of on the S:\ drive. Even though the executable is running from the S:\ drive. The OS default drive is not affected by where you run the executable from and will REMAIN as C: or C:\My Documents etc.. Seems to me that the S switch in Clkinout.exe is not working or its format is wrong. Can you change the OS default to S: without affecting the operation? Such as your bat file could be: S: CD MITC2000\T-TRACS CLKINOUT.EXE S "SC" The default is now S:\MITC2000\T-TRACS and the .exe is run from there. After program execution the default could be changed back to whatever using another CD command if required. In the shortcut currently used START IN: S:\MITC2000\T-TRACS does the same job as the CD command shown in the proposed file. Dusty, Thanks for the suggestion. I will try that today, and let you know the results. I think you may have solved the problem. I was trying to figure out how/why the .exe was looking on C:. Thanks again. Dusty, You are the man! It worked PERFECTLY. Thanks again for your help. I owe you one.You're welcome. Thanks for coming back with your result. |
|
| 8294. |
Solve : Machine name? |
|
Answer» HI All, I am looking for away to find the machine NAMES on my network. What I would like to do is find a name and than use it in a BATCH FILE than loop to the next machine name and use it etc... I am not sure how to start on this one. Can anyone GIVE me some help with this? Thanks Sorry to be so brief but batch files cannot run against a remote computer. |
|
| 8295. |
Solve : deleting files of same size? |
|
Answer» Hi again this time I need help with how I could get a batch FILE to compare the filesizes of two files and DELETE one of them if they are the same SIZE. I've been looking around for some time now but I figured that maybee somebody here could help me. |
|
| 8296. |
Solve : For Loop and Variables not appearing (another one???)? |
|
Answer» Well, I gave up after 25 screens of not finding my answer. |
|
| 8297. |
Solve : Is it possible to edit a text file from inside a batch file? |
|
Answer» HI, Any ppl out there know how to edit a text file using a batch file. Say i have a text file abc.text. I want to open it from a batch file, then add a line of text to it and close it this OPERATION has to be DONE by a batch file program. Thanks in advance Bijuecho linetoaddhere >>%folder%\mytxt.txt that will add a line that says "linetoaddhere" in folder\mytxt.txt using >> will add to the file , if you were to use a single > it would delete the file first.If you need to do quite complex things, just call your EDITOR from the batch file |
|
| 8298. |
Solve : Using Forefiles Command? |
|
Answer» I need to automate deletion of folders.. This just attempts to delete files inside directory Backup Does this mean that files in Backup are DELETED? Post back with comments please. Hi.. Yeah..files inside the backup FOLDER is deleted. But not the folders. Again files (eg .txt, .LOG etc) inside subirectories are not deleted. It is inconsistent deletion of files too inspite of using /s command. Thanks for helping me.Quote forfiles /p c:\Backup /s /m *.* /d -7 /c "cmd /c del @file" Why are you using /s /m etc...? The site I linked shows the commands are -s -m etc... Is there an updated version of Forfiles, if so please post a link to it. Sorry - ignore that - found the newer version instructions here. Continuing to investigate... Update... Using the version of Forfiles which I have (10,512 bytes dated 2/13/1999): Forfiles -pc:\ -m*.dat lists the .dat files in C: -- however using the forward slash (/) instead of hyphen (-) Forfiles lists all files in C: showing that it is using all the default settings, not picking up the settings entered. I think this is probably due to me not having the most recent version of Forfiles and I've not been able to find a later version than mine. Also get ERROR 2 when trying to echo any of the variables (@file @ext etc...) Please post details of your copy of Forfiles. Thanks Hi Dusty forfiles command works only on Windows 2003 Server. I have c:\backup\test\test.txt Im using: forfiles /p c:\backup /s /m *.* /d -7 /c "cmd /c del @file" This command deletes test.txt Now I run, forfiles /p c:\backup /s /m *.* /d -7 /c "cmd /c rd @file" This command deletes folder 'test' because it is empty, but doesn't delete folder 'backup'. Apparently, it starts searching from the top. It sees 'test' folder inside 'backup' folder, so it doesn't delete 'backup' folder. But when it sees 'test' folder is empty, it deletes it.Sorry about the delay in responding. Quote forfiles command works only on Windows 2003 Server. I have not been able to get forfiles to perform on Win.98se (FAT32)(Command.com) or perform perfectly on Win.XP Home (NTFS)(Cmd.exe or Command.com). In 98se an error is displayed for every file forfiles tries to delete, in XP a few of the sub-directories are left behind (on one trial 3 out of 25) although all files are deleted. However using WIN2k (FAT32)(Cmd.exe) forfiles does exactly what is wanted, all files and subdirectories are deleted although the parent directory remains.. Had to use a 2-line bat script to achieve this, two passes of forfiles were required, one to delete files, second to delete sub-directories. Here it is: forfiles -pD:\temp\ -S -M*.* -c"CMD /C DEL @FILE /Q" forfiles -pD:\temp\ -S -M*.* -c"CMD /C if @ISDIR==TRUE RD @FILE /S/Q" I will try W2k with NTFS when hardware becomes available. Sorry, I do not have a copy of 2003 Server with which to test forfiles.. |
|
| 8299. |
Solve : modifying a picture? |
|
Answer» I am making a PSP magazine. What this is is a group of photos that can be viewed like a magazine. The problem is that the PSP puts the photos in order according to their modified dates. Therefore I need to some way modify a group of .jpg's at the same time, but in order (001, 002, 003, ETC.) so that the modified time goes in order. I was THINKING a simple .bat maybe?What you want is to be able to 'Touch' your files, so the datestamp is UPDATED, but nothing ELSE is changed. |
|
| 8300. |
Solve : Activate messenger service? |
|
Answer» What MS-DOS command can ENABLE messenger service if messenger service is disabled (Startup type:disabled, service status:stopped) enable messenger serviceThink twice, before you proceed. |
|