Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

run syncronouscommand local

- - - - -

  • Please log in to reply
9 replies to this topic

#1
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
Ok so lets say I need to run syncronouscommand to run some files...but lets say I dont know what drive letter they will be, but the file will ALWAYS be on the same drive that vista is installing from.

For example, the dvd drive could be D or it could be E

...this is actually going on from a memory stick and the drive letter changes..either way, my question is,

when runsyncrnouscommand runs, what path is it executing from. Does it run from the root of the drive or from sources?

So another example, if runsyncrouscommand was running from the root, and my app was in a folder called apps on the root then the <path> would simply be /apps/file.exe

So you see what I mean about not specifying drive letter.

<RunSynchronousCommand wcm:action="add">
<Description>Copyapps</Description>
<Path>D:\programs\copyappsvista.cmd</Path>
<Order>1</Order>
<WillReboot>Never</WillReboot>
</RunSynchronousCommand>

So basically I want to be able to run copyappsvista.cmd without specifying drive letter, but whatever drive letter it is, the rest of the path will be the same.

I cant use %cdrom or %dvdrom flags because this is running from a flash drive.

Thanks in advanced.


How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,803 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

I can think of 2 options:

1. Have your install copy the program to install to the hard drive. Then write a wrapper (you can use AutoIT) that installs the program and then deletes the install files when it is done.
2. Put your app on a network share. Map the drive and then your drive letter shouldn't ever change.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#3
MrJinje

MrJinje

    Toolâ„¢ Developer

  • Developer
  • 1,039 posts
  • OS:none specified
  • Country: Country Flag
3) use the old for loop around the alphabet trick, or just go read it from the registry.

For The Cdrom you need to set the varible for it
Here are 2 different ways to do it,

FOR /F "TOKENS=3" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" ^| FINDSTR "SourcePath"') DO SET CDROM=%%~dI


for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

UPDATED FOR 7:
for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\sources\install.wim set MEDIA=%%iECHO %MEDIA%

EDIT: and you can use the CDROM variable with a USB disk, in fact you can call the variable anything you like, CDROM, MEDIA, it doesn't make any difference. As long as you use the same name later in the script when you try to access the variable. capisce

Edited by MrJinje, 06 February 2010 - 01:03 PM.


#4
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
thanks muchly.

i decided to go with cmdlines that copies all my install files to the c drive (for some reason the $ folders arent working) and then running it using C:\ since that never changes (except with stupid card readers sometimes arghhhh).

thanks again

#5
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
my mistake. I realized that i posted this question for vista and my solution was for xp (yeah im busy...getting confused between projects). so...i guess it isnt fixed.

So is there no way to just not use a drive letter?

for example, if my working directory was D:\sources and i specified \install\run.exe then the working path would be D:\sources\install\run.exe

See what I mean?

1. Have your install copy the program to install to the hard drive. Then write a wrapper (you can use AutoIT) that installs the program and then deletes the install files when it is done.


Well thats what I want to do, but i need to run a program to do that copying.

#6
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
Im going to go ahead and say that on my cmdlines for xp, i am using D:\programs\copyapps.cmd so i guess i've been using a drive letter the whole time and it hasnt broken yet..so i'll just go ahead and do that for vista and pray it doesnt break ;)

#7
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,803 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

Im going to go ahead and say that on my cmdlines for xp, i am using D:\programs\copyapps.cmd so i guess i've been using a drive letter the whole time and it hasnt broken yet..so i'll just go ahead and do that for vista and pray it doesnt break ;)


Remember that Vista may use different registry paths and DOES use different paths for the User profile and Programs, since there are no Documents and Settings or Program Files folders anymore. So if you are using any absolute paths for XP, you may need to change them. Easiest might be to detect which type of OS it is, and use one method for XP and the other for Vista.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#8
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
Ok so apparently in vista, it doesnt like my D:\Install\copyapps.cmd
I'm guessing its a problem with drive letters. works in xp no problem but for whatever reason, it doesnt here. SO I need a solution. What would be helpfull is knowing the working directory and put my copyapps.cmd in that and then use the patch \workingpath\copyapps.cmd instead of D:\install\copyapps.cmd

The problem is that this will be run on multiple computers, so while the main drive install will always be C:, the flash drive could be anything else.

#9
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,803 posts
  • OS:Server 2012
  • Country: Country Flag

Donator

If you are running this from Normal Mode (aka not Factory or Audit Mode) you may need to run this CMD elevated. I believe you can specify a runas option in a batch file. I've never done it myself.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#10
Jadestar

Jadestar

    Member

  • Member
  • PipPip
  • 106 posts
I found the solution, using $OEM$ folders in vista. I thought I read someonewhere else that this method didnt work in vista but it definately does, theres just a flag you have to enable in autounattend.xml. So now all my folders get copied to the root of the harddrive, which is always C: and then the commands run stuff from C: which works everytime.

Thanks for all the input guys.

*now i wonder why my $oem$ folders didnt work in xp..;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN