I work in a domain environment. I write a lot of little batch files to do simple installations of MSI often with MSTs. I have noticed I am constantly long handing the server names from which I am installing files in my batch files. We have some pretty serious standards in place that make me think that I should be able to use the same line of code to do this for me.
Basically all of our servers have the same format. In the directory where we find the batch file it is always the same. there is a batch file, and a folder with all of the installation material, msi, exe, mst etc. It always follows this format.
Root
Root>>>batch; install folder
Root>>>install folder>>>msi, mst, exe
My problem is that the server names change which changes the path to the root. Is there a way to pull the server name/directory path into my batch files so that I can write something similar to this?
::My batch
:SOF
Really cool coding here that makes a variable with the server path.
\\%dynamically assigned server path%\install.msi TRANSFORMS=\\%dynamically assigned server path%\trans_install.mst
:EOF
Any ideas how I can accomplish this?
Dynamically assigning root folder
Moderator: DosItHelp
-
- Posts: 16
- Joined: 07 Jun 2010 10:27
Re: Dynamically assigning root folder
FAIL....
%~dp0
Problem solved.
%~dp0
Problem solved.