Announcement

Collapse
No announcement yet.

Userid in scripts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Userid in scripts

    Is there some "trick" to the following. I would like to create a script that will sync 2 folders. My script as it is at the moment is
    Code:
    load "c:\documents and settings\USERID\local settings\Application data\MFE\USERID" "H:\mash\mfe\databaser\db2\USERID"
    sync update:left->right
    What I'm looking for is some sort of method of replacing the value USERID with the user's real userid.
    I have a workaround inasmuch as I can create the script file above on the fly, but it would be neater if I could change the script to something like
    Code:
    [I]set current_user = userid[/I]
    load "c:\documents and settings\[I]"current_user"[/I]\local settings\Application data\MFE\"[I]current_user[/I] "H:\mash\mfe\databaser\db2\"[I]current_user[/I]
    sync update:left->right
    (you get the idea)

  • #2
    Hello,

    You could use command line variables for the user id:
    bcompare.exe @script.txt "userid"
    bcompare.exe @script.txt "userid2"
    bcompare.exe @script.txt "userid3"

    script.txt:
    load "c:\documents and settings\"%1"\local settings\Application data\MFE\"%1 "H:\mash\mfe\databaser\db2\"%1
    sync update:left->right

    Is this the type of behavior/replacement you are looking for? Please test with test data/already backed up data.
    Aaron P Scooter Software

    Comment


    • #3
      Exactly what I was looking for

      Thanks Aaron

      Comment


      • #4
        Great to hear. If you need more detailed documentation, it is found in the BC3 Help file, in the Using Beyond Compare section -> Automating with Script, in the top level article (selecting the purple book icon.)
        Aaron P Scooter Software

        Comment

        Working...
        X