marcuscoker
Registered User.
- Local time
- Yesterday, 16:54
- Joined
- Sep 28, 2005
- Messages
- 49
Hi
I was wondering if anybody could help with this?
I am trying to create a textfile with code in it when a user clicks a button in an access form
Dim fso, myfile, fileText
Set fso = CreateObject("scripting.filesystemobject")
Set myfile = fso.createtextfile("c:\testfile.txt", True)
fileText = "@echo off
cls
echo Multi Asset Generator Script
echo.
echo You need to know the exact Marval Trakit asset classification
echo you will be using before you continue - you also need
echo to know the finance number detail. Ensure this information is
echo known before continuing.
echo ** Be careful typing - typos will cause the script to fail **
echo.
set /p repeats="How Many Assets to generate? >"
set /p category="Trakit Category? >"
set /p majortype="Trakit Major Type? >"
set /p minortype="Trakit Minor Type? >"
set /p startnum="Start Number Suffix From? (eg: for HF0001234 enter '1234') >"
set /p financeno="Finance Number to associate >"
set /p descrip="Description of Asset (eg: 'Dell PC') >"
echo PASS1 Start... (Generating %repeats% assets...)
set trakithome=c:\marvaltest\client
set /A repeats=%repeats%+%startnum%
for /L %%s IN (%startnum%,1,%repeats%) DO \\zurich\servicetest\timport asset /ini=\\zurich\servicetest\trakit.ini /user=system /asset=HF000%%s /description=xtag /category=%category% /major=%majortype% /minor=%minortype%
echo PASS1 Complete.
echo PASS2 Start .. Seeking 'xtag' marked assets and changing their description
echo and associating them with a Finance Record.
\\zurich\servicetest\cmdadmin /ini=\\zurich\servicetest\trakit.ini /update /db=trakit /table=asset /descrip=xtag descrip=#%descrip%# financeno=%financeno%
echo .. Done"
myfile.writeline (fileText)
myfile.Close
Because this code has line breaks and quotes in it, it does not work, but this is what i need to write to the file. Can anybody help?
Thanks
Marcus
I was wondering if anybody could help with this?
I am trying to create a textfile with code in it when a user clicks a button in an access form
Dim fso, myfile, fileText
Set fso = CreateObject("scripting.filesystemobject")
Set myfile = fso.createtextfile("c:\testfile.txt", True)
fileText = "@echo off
cls
echo Multi Asset Generator Script
echo.
echo You need to know the exact Marval Trakit asset classification
echo you will be using before you continue - you also need
echo to know the finance number detail. Ensure this information is
echo known before continuing.
echo ** Be careful typing - typos will cause the script to fail **
echo.
set /p repeats="How Many Assets to generate? >"
set /p category="Trakit Category? >"
set /p majortype="Trakit Major Type? >"
set /p minortype="Trakit Minor Type? >"
set /p startnum="Start Number Suffix From? (eg: for HF0001234 enter '1234') >"
set /p financeno="Finance Number to associate >"
set /p descrip="Description of Asset (eg: 'Dell PC') >"
echo PASS1 Start... (Generating %repeats% assets...)
set trakithome=c:\marvaltest\client
set /A repeats=%repeats%+%startnum%
for /L %%s IN (%startnum%,1,%repeats%) DO \\zurich\servicetest\timport asset /ini=\\zurich\servicetest\trakit.ini /user=system /asset=HF000%%s /description=xtag /category=%category% /major=%majortype% /minor=%minortype%
echo PASS1 Complete.
echo PASS2 Start .. Seeking 'xtag' marked assets and changing their description
echo and associating them with a Finance Record.
\\zurich\servicetest\cmdadmin /ini=\\zurich\servicetest\trakit.ini /update /db=trakit /table=asset /descrip=xtag descrip=#%descrip%# financeno=%financeno%
echo .. Done"
myfile.writeline (fileText)
myfile.Close
Because this code has line breaks and quotes in it, it does not work, but this is what i need to write to the file. Can anybody help?
Thanks
Marcus