Avatar of janoxley
janoxley
Flag 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
Microsoft DOSWindows OS

Avatar of undefined
Last Comment
Coralon

8/22/2022 - Mon
David Johnson, CD

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

ASKER
Thanks but if I'm not using pushd then which command do I use to change directory?
David Johnson, CD

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61
janoxley

ASKER
unfortunatly cd and chdir both give the "CMD does not support UNC paths as current directories" error. That's why I was using pushd.
David Johnson, CD

what pushd is doing is automatically mappping the unc path
map the directories manually and save the credentials
janoxley

ASKER
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..
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
David Johnson, CD

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Coralon

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