if not exist executes without permission

August 14, 2009 at 05:55:46
Specs: Windows XP
In the code below, the line: [if not exist %u_path% goto install_flash] executes the [goto install_flash] command even when the path assigned to u_path does not exist. Any advice, I'm a Newbie.

@echo off

setlocal enabledelayedexpansion

:user_name
for /f "tokens=3 delims=\" %%i in ("%USERPROFILE%") do (set user=%%i)

:set_cd
set original_dir=%cd%
cd /D c:\
set u_path="Documents and Settings\%user%\Application Data\Macromedia\Flash Player\#SharedObjects"
if exist %u_path% cd %u_path%
if not exist %u_path% goto install_flash


See More: if not exist executes without permission

Report •


#1
August 14, 2009 at 06:13:35
Solved!

Went with:

if exist %u_path% (
cd %u_path%
goto search
) else (
goto install_flash
)


Report •
Related Solutions


Ask Question