Link to home
Start Free TrialLog in
Avatar of janoxley
janoxleyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

using pushd via VPN

Hi,
 
   I worked from home last night and came across an issue when using the pushd command to change directory. This is on a windows 7 laptop.


   I have some batch files (.bat) and command files (.cmd) that load data to Oracle (on a separate server) via SQLLDR, run some oracle stored procs and use SQLPLUS to extract data.

  All the various files are on network drives at work (\\server\share type thing)

  In my bat, cmd and sql files i use the pushd command to change the current file path to one of these network drives (e.g. pushd "\\myserver.abc.com\cde\....."    <-- using inverted commas)

 This all works fine when I'm at work directly connected to the network but If I'm at home using a VPN connection then my bat/cmd files give an access denied message.
 
 Now, when at home I can access these folders using windows explorer etc, I can save, ammed, create and delete files quite happily. But I'm getting this odd access denied msg when using pushd.

 I specifically use pushd as the folder paths have spaces in them.

Can anyone help?

Cheers
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

if a directory has spaces in it then enclosing it in quotes is sufficient, no need to use pushd
Avatar of janoxley

ASKER

Thanks but if I'm not using pushd then which command do I use to change directory?
the standard dos commands cd  or chdir
I would suggest doing a dir afterwards
or encapsulate it in a scripting language i.e. powershell, vbscript that uses a try /catch statement.
unfortunatly cd and chdir both give the "CMD does not support UNC paths as current directories" error. That's why I was using pushd.
what pushd is doing is automatically mappping the unc path
map the directories manually and save the credentials
The problem with that is that this process could be run from any pc/logon and I can't be certain that the drives will all have the same drive letters (in fact I can be pretty sure that they won't). This is why I use UNC in the first place.

Really the question I'm trying to answer is why pushd would give "access denied" via VPN but not when I'm at work..
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think ve3ofa is correct, it looks like the credentials are not passing through.  

If you are using multiple shares on the machine, then what you can do is:

net use \\server\ipc$ /user:domain\user

Open in new window


since you are on a vpn, you might need to use \\server.domain.com  (whatever the proper name is).

you'll get prompted for your password, and once you have established that button, you should be able to use your pushd and popd without an issue.  

If that doesn't work, there is a good chance your network admins may be blocking windows networking traffic from the VPN.

Coralon