[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Batch file permission problem with subst command

Posted on 2009-02-13
12
Medium Priority
?
920 Views
Last Modified: 2012-05-06
Windows XP (all service packs)

Hi,

When I run the following from the DOS command prompt:

subst O: C:\myPath

I get the following response:

Access is denied


I'm not sure where to start looking to see why this fails. Thanks.
0
Comment
Question by:BradleyOnTheRoad
  • 7
  • 4
12 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 23636888
Is O already mapped?
Do you have access to C:\myPath?
0
 

Expert Comment

by:coolcasual
ID: 23637812
does c:\mypath exist? and do you have access to it?
and also make sure O: is not already mapped.

0
 
LVL 67

Expert Comment

by:sirbounty
ID: 23638035
<echo>... :^)
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

Author Comment

by:BradleyOnTheRoad
ID: 23640704
O is not mapped. I am able to view C:\myPath contents through Explorer and make saves, deletes, copies and pastes.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 23640863
So,  can you subst some other drive?  Can you subst some other path?

Try
subst W: %systemroot%
for example...
0
 

Author Comment

by:BradleyOnTheRoad
ID: 23641237
Tried subst W: %systemroot%

but still got Access is denied.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 23641246
Logged in as an admin?  If not, let's try that...
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 23641258
Oh, and try this command:

subst x: %userprofile%
0
 

Author Comment

by:BradleyOnTheRoad
ID: 23641650
Tried subst x: %userprofile%, but still got Access is denied.

However, I went to my user account and it is a "unknown account type", so I don't know if I can log in as admin. It's a work computer.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 23641720
May be because it's a limited account then, though I'm unsure...I'll check on an xp device shortly...
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 2000 total points
ID: 23644723
Tried several folders as the most basic user on XP with no permission problems.  Although my userprofile had to be typed in quotes:

subst u: "%userprofile%"

This is because it resolves to C:\Documents and Settings\UserName and that path has spaces in it...

Try that way.
If it still fails, let's check the event logs:
Start->Run->Eventvwr <Enter>
0
 

Author Closing Comment

by:BradleyOnTheRoad
ID: 31546756
I wasn't able to get the DOS command to work. However, I found a workaround by downloading and using a visual drive mapping program called Vsubst. Thanks for your help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question