1.

Solve : Pls help with path independent batch files?

Answer»

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,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 universalThe 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,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. I wasn't looking for a system variable but thanks for your reply.



Discussion

No Comment Found