Jump to content

Script help, (saving from one partition to another)


Recommended Posts

I have a script here, that saves the logs of a program from its directory to a folder in the same directory, I have that program on a read only partition though, so I cant save the logs from the partition to the same partition because its read only.

This partition is on a usb drive, and its shows up as 2 drives. I'm wondering if anyone here knows how I can run a program on one partition, and save to another partition, but still keep it portable. Because with usb drives, the drive letter changes usually as you connect to different computers.

This is the script:

Run(@ComSpec & ' /k "COPY .\take\*.txt .\take\all.txt"', @ScriptDir, @SW_HIDE)
sleep(3000)

Dim $DateTime = @YEAR & "-" & @MON & "-" & @MDAY & "-" & @HOUR & "-" & @MIN & "_" & @SEC
Dim $Location = @WorkingDir & '.\take\'
Dim $FileName = "all.txt"

FileMove($Location & $FileName , $Location & $DateTime & ".log",1)
sleep(3000)

The file save location is set as the working directory, but I want to send it to the directory of the other partition, is this possible? and if so, how?

I don't know how wild cards work with AutoIt either.

Link to comment
Share on other sites

One quick look in the helpfile came up with the commands "DriveGetSerial", and "DriveGetDrive"

First obtain the serial number of the partition:

$sDrive = DriveGetSerial ("PathToUSBHardDrive") ; Do this to get the USB drive's serial number.
oÝ÷ Ù8^)ò¢êìr¸©¶ë¶¬¶¶+lv¸¯zW­µêÚºÚ"µÍÌÍÜÑ]HH   ][ÝÔÙX[[XI][ÝÈÈÈÛÝ[HHÙX[[X[ÝØ]HËÌÍØQ]ÈH]QÙ]]J ][ÝÐS ][ÝÊHÈIÌÎNÛHÝÝHYHTÐ]HÛÝ[ÈÈH    ][ÝÑVQ    ][ÝÈÛKÜH    ][ÝÔSSÕPI][ÝÈÛKYÜHHÙY   ][ÝÐS ][ÝËÌÍÑ]S]H    ][ÝÉ][ÝÂÜ  ÌÍÚHHHÈ ÌÍØQ]ÖÌBRY]QÙ]ÙX[
    ÌÍØQ]ÖÉÌÍÚWJHH  ÌÍÜÑ]H[BIÌÍÑ]S]H ÌÍØQ]ÖÉÌÍÚWBBQ^]ÛÜQ[Y^ÙÐÞ
    ][ÝÖ[ÝXYÚXØ[]HÚ]É][ÝÈ  [È ÌÍÜÑ]K  ][ÝÐØ[HÝ[]  ][ÝÈ  [È ÌÍÑ]S]BoÝ÷ Ú«¨µéÚ

Edit:

Made it a little clearer.

Edited by FreeFry
Link to comment
Share on other sites

would I have to run another script to find the serial?

and thanks :)

if you want, I could post my whole script, to make sure it works.

you wouldn't mind If I pmed it to you, would you?

Edited by Sleepybear
Link to comment
Share on other sites

Oh, sorry, I was away for a while.

Yes, you first need to determine the serial number of the partition(I'm not totally sure, but I think that the serial number does never change), then when you know that, you can statically use that in your 'real' script.

Sure, PM me it, and I'll have a look. :)

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
 Share

  • Recently Browsing   0 members

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