Jump to content

Yzöwl

Patron
  • Posts

    4,113
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by Yzöwl

  1. Welcome to the MSFN forums. I'd like to get into beautiful and intriguing females too, where do I start?
  2. Welcome to the Microsoft Superhero Forum for Networkers, I hope you enjoy your stay!
  3. What was this Not only were possible methods suggested, but you were also told that the solution may be application dependant. Since you have failed to supply further information or the application name, I fail to understand how you can expect much more in the way of help!.Oh and by the way, do not bump posts after less than half a day and on a weekend too!
  4. Just to ensure that my idea of what you are trying to achieve is correct, here's the TEST.TXT for my examples: I_AM_A_LINE_WITH_A_TRAILING_UNDERSCORE_ I_AM_A_LINE_WITH_TWO_TRAILING_UNDERSCORES__ I_AM_A_LINE I_AM_A_LINE_TOO I AM ANOTHER LINE WITH A TRAILING UNDERSCORE_ I AM ANOTHER LINE WITH TWO TRAILING UNDERSCORES TOO__ I AM ANOTHER LINE I AM ANOTHER LINE TOO As shown by IcemanND, the best way is to use a subroutine, I include this mainly due to an error in Ice's example: @ECHO OFF&SETLOCAL FOR /F "DELIMS=" %%? IN (TEST.TXT) DO CALL :SUB "%%?" PAUSE&ENDLOCAL&GOTO :EOF :SUB SET "VAR=%~1" IF %VAR:~-1%==_ ECHO/ %VAR%&ECHO/ Changes To&ECHO/ %VAR:~0,-1%&ECHO/In order to grab only lines ending with an underscore, I suggest using findstr. @ECHO OFF&SETLOCAL FOR /F "DELIMS=" %%? IN ('FINDSTR/E "_" TEST.TXT') DO CALL :SUB "%%?" PAUSE&ENDLOCAL&GOTO :EOF :SUB SET "VAR=%~1" ECHO/ %VAR%&ECHO/ Changes To&ECHO/ %VAR:~0,-1%&ECHO/Here is an example using delayed expansion @ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION FOR /F "DELIMS=" %%? IN ('FINDSTR/E "_" TEST.TXT') DO ( SET "VAR=%%?"&&ECHO/ !VAR!&ECHO/ Changes To&ECHO/ !VAR:~0,-1!&ECHO/) PAUSE&ENDLOCAL&GOTO :EOFI hope this helps you a little better!
  5. You could enable and use delayed expansion, however if any of your lines contained exclamation marks, you'd have problems. My suggestion is therefore to use call: @ECHO OFF&SETLOCAL FOR /F "DELIMS=" %%? IN (TEST.TXT) DO (SET VAR=%%? ECHO/Should take `String_` and return `_`&CALL ECHO/%%VAR:~-1%%&ECHO/ ECHO/Should take `String_` and return `String`&CALL ECHO/%%VAR:~0,-1%%&ECHO/) PAUSE
  6. Does this help you? @ECHO OFF FOR /F "DELIMS=" %%? IN ("Test_") DO SET VAR=%%? ECHO/Should take Test_ and return _ ECHO/%VAR:~-1% ECHO/ ECHO/Should take Test_ and return Test ECHO/%VAR:~0,-1% ECHO/ PAUSE EXIT
  7. @Rob, you issue regini using a file as the parameter so you would need to write a file using your script, then run regini using that file as the parameter. Attached is an XP batch file which should give you enough to complete your task. Basically it gets your SID, writes the ini file and invokes regini using it. Note Please do not just run this file as is! Change lines 5-9 incl to suit your particular requirement USID.zip
  8. This may be a complete `shot in the dark`, I have read none of this thread and know nothing of the application. I did however look at your example and I am guessing, that the " character(s) on that line could potentially be giving you your error! <Edit> Those should normally be escaped. </Edit>
  9. I'm not! BTW, welcome to MSFN.
  10. Hello and welcome to the MSFN Forums.
  11. Yzöwl

    Hi

    Welcome Ed to MSFN.
  12. Welcome to MSFN, please don't forget to read the rules etc.
  13. Welcome Henk to the MSFN Forums.
  14. Hello and welcome to our Forums.
  15. Yzöwl

    Hello

    Welcome to the MSFN Forums Niz.
  16. Hello and welcome to the MSFN Forums Garrett.
  17. In order to run the command provided by you I have provided you with the correct syntax. If your provided information was incorrect then of course that was beyond the scope of the original question.
  18. the problem with that solution was probably the addition of the extra quotes, which weren't necessary and if required would have needed escaping. This should have been fine REG ADD %KEY%\001 /V 1 /D "cmd /c runas /u:Username filetorun | sanur password" /f
  19. Yzöwl

    Howdy

    Welcome to the 'great operation' that is the MSFN Forums.
  20. Welcome to the MSFN Forums; enjoy participating.
  21. Hello Kelly, and welcome to the MSFN Forums.
  22. IcemanND, you took the words right out of my mouth... The most efficient method of doing the task is to prevent the registry key being altered in the first place. I do not know what level the application is curently working at, but would suggest you change the registry keys to something like: Everyone - Read access Administrators - Full Access System - Full Access Then if the key still changes adjust the permissions to suit. You need to be careful however not to freeze yourself out of the key completely! Trying to schedule a script every five minutes or run one constantly on a timer looks like a waste of resources. If the registry permissions continue to give you problems you may need to see if someone could create an app specific to your task. This app would probably need to use the Windows API RegNotifyChangeKeyValue with the REG_NOTIFY_CHANGE_LAST_SET in order to 'monitor' the specific key and delete it if TRUE.
  23. Since this is not a paid for service site, and your task isn't likely to be part of larger, secret, commercial program, please be more specific. If you provide us with the registry key, value and time lapse specifics, you may be lucky enough to receive examples in one or more scripting languages. There may also be one or more alternative methods of producing the result you require without using the method you have described. It really is more efficient when you are asking for help to give specifics.
  24. I didn't know we were lost, but thank you anyhow!Oh and welcome to the MSFN Forums
  25. You are correct, I wasn't referring to HFSLIP directly, however I use CMDOW and incorporate it using HFSLIP, due to this reason, I see no need to use another, less useful, tool. There are some occasions when I use some of the other functions of CMDOW during my installations.
×
×
  • Create New...