Jump to content

Command help


Recommended Posts

How do i through command test two variables?

I need it for my cleanup command as follows.

If Programfiles\Photoshop or Programfiles\Illustrator exists and dir TEST not exist

then MKDIR TEST.

To lay it down simply what I want :P Is there a way to do this?

Link to comment
Share on other sites


why not just use 2 commands...if exist photoshop md test...if exist illustrator md test...you say or, you dont say both have to exist...and with md, it wont overwrite all your files, itll just error saying dir already exists, so no big deal there.

PS..Im gonna assume this ties in with your post in the Applications subforum...why not keep everything in one place...it makes it easier if everyone has all the info needed.

Edited by evilvoice
Link to comment
Share on other sites

True that, it does link to this topic. Put it here as it was more of a unattend question, but sure, could have continued on. Anyways...

Sure there are a couple of ways to solve this, but as im also trying to learn while I make my CD, it's good to know if something like the above is even possible. Now a solution would as you say be something like this.

@echo off
if exist "%ProgramFiles%\Adobe\Adobe Photoshop CS2" mkdir "%UserProfile%\My documents\Updater"
if exist "%ProgramFiles%\Adobe\Adobe Illustrator CS2" if not exist "%UserProfile%\My documents\Updater" mkdir "%UserProfile%\My documents\Updater"
if exist "%UserProfile%\My documents\Updater" ATTRIB +H "%UserProfile%\My documents\Updater"
exit

That way no erros will occure. :)

Edited by BoardBabe
Link to comment
Share on other sites

From the code you've given, this should set you on the right track.

if exist "%ProgramFiles%\Adobe\Adobe*CS2" (
 if not exist "%UserProfile%\My Documents\Updater" (
   md "%UserProfile%\My Documents\Updater"
 )
 attrib +h "%UserProfile%\My Documents\Updater"
)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...