Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Pls help with path independent batch files  (Read 3111 times)

0 Members and 1 Guest are viewing this topic.

x3g

    Topic Starter


    Rookie

    Pls help with path independent batch files
    « on: March 18, 2009, 01:52:26 PM »
    hey all
    I have some UNC paths in my batch files that do not exist at other network locations. I'm wondering if there's a way to get rid of the paths so that my coworkers dont have to modify the batch files to match their network drive mapping.
    thanks,

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Pls help with path independent batch files
    « Reply #1 on: March 18, 2009, 02:59:29 PM »
    Can you please share code so we can see what you are trying to achieve.... probably going to want to create a path that points to C:\somefolder to make universal

    x3g

      Topic Starter


      Rookie

      Re: Pls help with path independent batch files
      « Reply #2 on: March 18, 2009, 03:28:04 PM »
      The batch file is a silent install which runs an MSI off a network share, the path to the msi is something like this
      \\servername\xxx\xxxxx\install.msi
      If somehow I can get rid of the specific location infront of the msi then I can distribute the script to other support folks so they can run the silent install without having to change the path to match their network share.
      thanks,

      BatchFileCommand



        Hopeful
      • Thanked: 1
        Re: Pls help with path independent batch files
        « Reply #3 on: March 18, 2009, 03:55:25 PM »
        I don't quite know what you are doing. But here are the system-set variables.


        Code: [Select]
        ALLUSERSPROFILE = C:\ProgramData

        APPDATA = C:\Users\username\AppData\Roaming

        CommonProgramFiles = C:\Program Files\Common Files

        COMPUTERNAME = LAPTOPCOMPUTER

        ComSpec = C:\Windows\system32\cmd.exe

        FP_NO_HOST_CHECK = NO

        HOMEDRIVE = C:

        HOMEPATH = \Users\username

        LOCALAPPDATA = C:\Users\username\AppData\Local

        LOGONSERVER = \\LAPTOPCOMPUTER

        NUMBER_OF_PROCESSORS = 2

        OS = Windows_NT

        PROCESSOR_ARCHITECTURE = x86

        PROCESSOR_IDENTIFIER = x86 Family 6 Model 15 Stepping 13, Genuin

        PROCESSOR_LEVEL = 6

        PROCESSOR_REVISION = 0f0d

        ProgramData = C:\ProgramData

        ProgramFiles = C:\Program Files

        PROMPT = $P$G

        PUBLIC = C:\Users\Public

        SESSIONNAME = Console

        SystemDrive = C:

        SystemRoot = C:\Windows

        TEMP = C:\Users\username\AppData\Local\Temp

        TMP = C:\Users\username\AppData\Local\Temp

        USERDOMAIN = LaptopComputer

        USERNAME = username

        USERPROFILE = C:\Users\username

        windir = C:\Windows




        The results vary, but those are variables that are set by the system. 
        οτη άβγαλτος μεταφ βαθμολογία

        x3g

          Topic Starter


          Rookie

          Re: Pls help with path independent batch files
          « Reply #4 on: March 18, 2009, 04:38:31 PM »
          I wasn't looking for a system variable but thanks for your reply.