Sponsored Content
Full Discussion: DOS bat file to add to path
Special Forums Windows & DOS: Issues & Discussions DOS bat file to add to path Post 302846829 by LMHmedchem on Monday 26th of August 2013 01:28:26 AM
Old 08-26-2013
DOS bat file to add to path

This may not be the right place, since it is not exactly unix or linux, but it does involve cygwin. I have two cygwin installations. When I start a mintty terminal, I need to toggle a windows path variable to make sure that the correct cygwin dll gets loaded.

I need to add
Code:
C:\cygwin\bin

to the windows path for one of the installs. I can make a bat file with,

Code:
SET PATH = C:\cygwin\bin;%PATH%;

as far as I know, this will add the right string to the path. The issue is that I need this to be temporary for the session only. I am not sure how to do this. I may be able to use "setlocal", but when the bat file finishes, it will close and I'm guessing that the temp assignment to the path will go with it. This means that I would need to have the bat file stay open until I close it intentionally when I am done. It would be more useful to have the path addition stay put until I close the mintty terminal, but I'm not sure how to do that. I suppose I could have a bat file that would add cygwin to the path and then another one that would remove it, but it seems like there should be a better way than that. I guess I could also just open a cmd terminal and add cygwin to the path there and remove it when I was done.

I would like to just have a desktop shortcut that would add cygwin to the path, open a mintty terminal, and then when I am done, restore the path to it's original value. It doesn't seem as if that should be that difficult, but I'm not making much progress with google.

Let me know if this just isn't the right place and I will look elsewhere.

LMHmedchem

Last edited by Scrutinizer; 08-26-2013 at 04:08 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can Unix (Solaris) execute a dos .bat script?

I did a search and found lots of questions/comments about how a dos script could execute Unix but not the other way round. If it's possible, I'd like the link to a post/site that would show me the way. Thanks. (4 Replies)
Discussion started by: BCarlson
4 Replies

2. Windows & DOS: Issues & Discussions

compatibility cygwin / with dos-path

when i run in dos for example: C: ls /temp ls: cannot access /temp: No such file or directory but when i run C: ls \temp windriver backup remotebackup also when i run C: ls temp windriver backup remotebackup The problems that i have all developpers scripts was written first like this... (0 Replies)
Discussion started by: mulder20
0 Replies

3. Linux

dos-path / un-dos-path compatibility with cygwin

Hello ; I have a problem running some script on dos . when i run : C: ls /temp ls: cannot access /temp: No such file or directory but when i run C: ls \temp windriver backup remotebackup also when i run C: ls temp windriver backup remotebackup The... (4 Replies)
Discussion started by: mulder20
4 Replies

4. Shell Programming and Scripting

Simple bat file

Hi guys, I need a *.bat to run a ksh file in the shell on Windows NT...nothing more :) How do I do it? I tried with the following but it failed: set INFORMIXDIR=D:\user-applications\informix set PATH=%INFORMIXDIR%;%PATH% D:\user-applications\MKS\mksnt\sh.exe C:\hk_9.2\C3_weekly_auto.ksh... (4 Replies)
Discussion started by: Dird
4 Replies

5. Windows & DOS: Issues & Discussions

DOS Dir - listing of full path and timestamp

Hi, (Apologies, I'm sure I'm not the first person to raise this question but so far in my searches haven't found a good answer). I would like to output a listing per line of filename (including full path) and 'last updated' timestamp. e.g: Z:\dir1\file1.txt 01/02/2010 10:43... (5 Replies)
Discussion started by: GM_AIX
5 Replies

6. Shell Programming and Scripting

Building a DOS .bat file that will root my Droid 2 phone using adb

1. What I am doing? Building a DOS .bat file that will root my Droid 2 phone using adb commands in the .bat file. (Just for the fun of it and to help me learn "stuff".) 2. Problem: Here are the problem steps to accomplish this task manually in an adb shell: adb shell (Prompt is $) cd... (2 Replies)
Discussion started by: chrstdvd
2 Replies

7. Solaris

cannot add PATH to user crontab file

hi All, here is the problem: I'm not able to specify a PATH inside the user crontab file (/var/spool/cron/crontabs). The only syntax it accepts is the usual "* * * * * file" I'm not able to add PATH, or HOME, or MAILTO, or anything else. when I try to save the crontab, I have the error: ... (1 Reply)
Discussion started by: joe_x
1 Replies

8. Shell Programming and Scripting

Need help with bat file!!!

I need to put/get files from Windows machine to Unix machine and vice-versa. I wrote a text file "ftp1.txt" as below. naga naga06 cd /root/Naga prom off get time.unl bye I wrote another bat file "ftp.bat" as below. ftp -n -s:C:\Users\Naga\Desktop\ftp1.txt IP_ADDRESS but... (2 Replies)
Discussion started by: Naga06
2 Replies

9. Windows & DOS: Issues & Discussions

Avoiding DOS space related "path not found errors"

Well I have a lot of scripts that require dragging and dropping files in order to define Source files etc. However more often then not it is the case that the path to said file contains NUMEROUS spaces. I know one way to evade this problem is to encase the path in Quotes like this: ... (7 Replies)
Discussion started by: pasc
7 Replies

10. UNIX for Beginners Questions & Answers

How do I add a log file path to a vi file to monitor all the changes made to the file?

I'm curious to know how do I add an empty log file (test1.log) to an existing text file to monitor all the changes made to a.txt. Is this expression export PATH=$PATH:/home/test1.log right to be added to the text file a.txt? (5 Replies)
Discussion started by: TestKing
5 Replies
GVPE.OSDEP(5)						   GNU Virtual Private Ethernet 					     GVPE.OSDEP(5)

NAME
gvpe.osdep - os dependent information DESCRIPTION
This file tries to capture OS-dependent configuration or build issues, quirks and platform limitations, as known. TUN vs. TAP interface Most operating systems nowadays support something called a tunnel-device, which makes it possible to divert IPv4 (and often other protocols, too) into a user space daemon like gvpe. This is being referred to as a TUN-device. This is fine for point-to-point tunnels, but for a virtual ethernet, an additional ethernet header is needed. This functionality (called a TAP device here) is only provided by a subset of the configurations. On platforms only supporting a TUN-device, gvpe will invoke it's magical ethernet emulation package, which currently only handles ARP requests for the IPv4 protocol (but more could be added, bu the tincd network drivers might need to be modified for this to work). This means that on those platforms, only IPv4 will be supported. Also, since there is no way (currently) to tell gvpe which IP subnets are found on a specific host, you will either need to hardwire the MAC address for TUN-style hosts on all networks (and avoid ARP altogether, which is possible), or you need to send a packet from these hosts into the vpn network to tell gvpe the local interface address. Interface Initialisation Unless otherwise notes, the network interface will be initialized with the expected MAC address and correct MTU value. With most interface drivers, this is done by running /sbin/ifconfig, so make sure that this command exists. Interface Types native/linux TAP-device; already part of the kernel (only 2.4+ supported, but see tincd/linux). This is the configuration tested best, as gvpe is being developed on this platform. ifname should be set to the name of the network device. To hardwire ARP addresses, use iproute2 (arp can do it, too): MAC=fe:fd:80:00:00:$(printf "%02x" $NODEID) ip neighbour add 10.11.12.13 lladdr $MAC nud permanent dev $IFNAME tincd/linux TAP-device; already part of the kernel (2.2 only). See native/linux for more info. ifname should be set to the path of a tap device, e.g. /dev/tap0. The interface will be named accordingly. native/cygwin TAP-device; The TAP device to be used must either be the CIPE driver (http://cipe-win32.sourceforge.net/), or (highly recommended) the newer TAP-Win32 driver bundled with openvpn (http://openvpn.sf.net/). Just download and run the openvpn installer. The only option you need to select is the TAP driver. ifname should be set to the name of the device, found in the registry at (no kidding :): HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNetwork{4D36E972-E325-11CE-BFC1-08002BE10318}<adapterid>ConnectionName The MAC address is dynamically being patched into packets and ARP-requests, so only IPv4 works with ARP on this platform. tincd/bsd TAP-device, maybe; migth work for many bsd variants. This driver is a newer version of the tincd/*bsd drivers. It might provide a TAP device, or might not work at all. You might try this interface type first, and, if it doesn't work, try one of the OS-specific drivers. tincd/freebsd TAP-device; part of the kernel (since 4.x, maybe earlier). ifname should be set to the path of a tap device, e.g. /dev/tap0. The interface will be named accordingly. These commands might be helpful examples: ifconfig $IFNAME 10.0.0.$NODEID route add -net 10.0.0.0 -netmask 255.255.255.0 -interface $IFNAME 10.0.0.$NODEID tincd/netbsd TUN-device; The interface is a point-to-point device. To initialize it, you currently need to configure it as a point-to-point device, giving it an address on your vpn (the exact address doesn't matter), like this: ifconfig $IFNAME mtu $MTU up ifconfig $IFNAME 10.11.12.13 10.55.66.77 route add -net 10.0.0.0 10.55.66.77 255.0.0.0 ping -c1 10.55.66.77 # ping once to tell gvpe your gw ip The ping is required to tell the ARP emulator inside GVPE the local IP address. ifname should be set to the path of a tun device, e.g. /dev/tun0. The interface will be named accordingly. tincd/openbsd TUN-device; already part of the kernel. See tincd/netbsd for more information. native/darwin TAP-device; The necessary kernel extension can be found here: http://www-user.rhrk.uni-kl.de/~nissler/tuntap/ There are two drivers, the one to use is the "tap" driver. It driver must be loaded before use, read the docs on how to install it as a startup item. ifname should be set to the path of a tap device, e.g. /dev/tap0. The interface will be named accordingly. These commands might be helpful examples: ifconfig $IFNAME 10.0.0.$NODEID route add -net 10.0.0.0 -interface $IFNAME 255.255.255.0 tincd/darwin TUN-device; See tincd/netbsd for more information. native/darwin is preferable. The necessary kernel extension can be found here: http://chrisp.de/en/projects/tunnel.html ifname should be set to the path of a tun device, e.g. /dev/tun0. The interface will be named accordingly. The driver must be loaded before use: kmodload tunnel tincd/solaris TUN-device; already part of the kernel(?), or available here: http://vtun.sourceforge.net/tun/ Some precompiled tun drivers might be available here: http://www.monkey.org/~dugsong/fragroute/ The interface MAC and MTU are NOT set up for you. Please try it out and send me an ifconfig command invocation that does that. See tincd/netbsd for more information. Completely untested so far. tincd/mingw TAP-device; see native/cygwin for more information. The setup is likely to be similar to native/cygwin. Completely untested so far. tincd/raw_socket TAP-device; purpose unknown and untested, probably binds itself on an existing ethernet device (given by ifname). It must be down prior to running the command, and GVPE will try to set it's MAC address and MTU to the "correct" values. Completely untested so far. tincd/uml_socket TAP-device; purpose unknown and untested, probably creates a UNIX datagram socket (path given by ifname) and reads and writes raw packets, so might be useful in other than UML contexts. No network interface is created, and the MAC and MTU must be set as appropriate on the other side of the socket. GVPE will exit if the MAC address doesn't match what it expects. Completely untested so far. tincd/cygwin Known to be broken, use native/cygwin instead. SEE ALSO
gvpe(5). AUTHOR
Marc Lehmann <gvpe@schmorp.de> 2.2 2008-09-01 GVPE.OSDEP(5)
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy